Displaying 2 results from an estimated 2 matches for "before_initialization".
2008 Apr 21
0
Lost Polymorphic Associations in development environment causes delegate :blah, :to => to fail
...The solution I have tried are and none have worked are
1). put a require_dependency ''models/profile'' in environment.rb
2). put a require ''models/profile'' in models/user.rb
3). put a load ''models/profile.rb'' in models/user.rb
4).
class User
def before_initialization
Profile.find(1) #just to load the Profile class, I know this looks
stupid and desperate
end
end
The only solution that works is
config.cache_classes = true #in development.rb
but as you know this is not acceptable.
Any ideas, what might be causing this bug and how I can fix it.
Regards,
-da...
2010 Sep 09
0
Rails3: jquery-rails gem sets 'config.action_view.javascript_expansions' but cannot be overriden in 'config/application.rb'
Hello,
I''ve created a new Rails3 app and I''m using jQuery instead of prototype.
Gemfile:
gem ''jquery-rails''
in my config/application.rb I want do the following:
config/application.rb
if Rails.env.production?
config.action_view.javascript_expansions[:defaults] = %w(jquery.min
rails application)
else