search for: before_initialize

Displaying 2 results from an estimated 2 matches for "before_initialize".

2008 Apr 21
0
Lost Polymorphic Associations in development environment causes delegate :blah, :to => to fail
Hi All I have been struggling with this issue for a long time now. And before I began to describe the problem its important to know that this problem happens only in Development environment. I am using Rails 2.0.2, here are my associations class User has_many :comments has_one :profile, :as => :profileable delegate :email, :to => :profile end First call to comment.user.email works
2010 Sep 09
0
Rails3: jquery-rails gem sets 'config.action_view.javascript_expansions' but cannot be overriden in 'config/application.rb'
...pplication) end So in production I want to include jquery.min whereas in development I want the unminified (jquery). But this seems not to work and when I look at the jquery-rails railtie, I see the following code: module Jquery module Rails class Railtie < ::Rails::Railtie config.before_initialize do if ::Rails.root.join("public/javascripts/jquery-ui.min.js").exist? config.action_view.javascript_expansions[:defaults] = %w(jquery.min jquery-ui.min rails) else config.action_view.javascript_expansions[:defaults] = %w(jquery.min rails) end...