similar to: `alias_method_chain': undefined method `find' for class `ActiveRecord::Base' (NameError)

Displaying 20 results from an estimated 8000 matches similar to: "`alias_method_chain': undefined method `find' for class `ActiveRecord::Base' (NameError)"

2007 Jun 12
1
alias_method_chain and Class methods (a Ruby question)
Hello list, I am trying to override the post_form method of Net::HTTP so that it does something before actually doing the post. I tried the following in environments/development.rb module Net class HTTP alias_method_chain :post_form, :intercept def post_form_with_intercept(url, params) # Do something before post logger.info(''About to post at
2009 Dec 29
1
undefined method `alias_method_chain' for I18n::Backend::Simple:Class
Hi, We are running RE: ruby 1.8.7 (2009-06-12 patchlevel 174) [sparc-solaris2.10], MBARI 0x8770, Ruby Enterprise Edition 2009.10 I tried a simple web app with a controller rendering a text and is working in my PC but on the server I get: Error message: undefined method `alias_method_chain'' for I18n::Backend::Simple:Class Exception class: NoMethodError Application root:
2008 Mar 28
1
undefined method ''alias_method_chain''
Running Rails 2.0.2, I get this error: ./script/../config/../vendor/plugins/facebooker/lib/facebooker/rails/facebook_url_rewriting.rb:29: undefined method `alias_method_chain'' for ActionController::UrlRewriter:Class (NoMethodError) from /usr/local/rubygems/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from
2009 Apr 26
1
validators.rb breaks after update from Rails 2.2.2 to 2.3.2
I just updated my rails application from 2.2.2 to 2.3.2 and the following message is displayed while trying to start with ./script/ server: [code] => Booting Mongrel => Rails 2.3.2 application starting on http://0.0.0.0:3000 /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/ active_support/core_ext/module/aliasing.rb:33:in `alias_method'': undefined method `valid?''
2009 Jan 20
0
alias_method_chain in Facebooker Causing Stack Level Too Deep
I installed the Facebooker plugin and upon placing it on a staging server, I keep running into stack level too deep errors. It seems to stem from Facebooker using alias_method_chain to override some of the ActionController methods. I believe it''s getting loaded twice causing confusion. I''ve tried various methods include wrapping a unless respond_to?(:method) around the
2009 Mar 21
2
ApplicationHelper::WillPaginate (NameError)
What wrong? environment.rb require "will_paginate" application_helper.rb include WillPaginate::ViewHelpers def will_paginate_with_i18n(collection, options = {}) will_paginate_without_i18n(collection, options.merge(:previous_label => I18n.t(:previous), :next_label => I18n.t(:next))) end alias_method_chain :will_paginate, :i18n
2006 Dec 26
0
alias_method_chain vs. redefined method with super
I''m trying to fully understand the subtleties of using alias_method_chain to refine method behavior versus redefining a method and calling super. I have a simple data model (a music collection) that I often use to evaluate web frameworks, and I''m trying to get it working on Rails 1.2.0RC1. Specifically, I have three classes which subclass a common Artist class: - Band
2007 Apr 12
0
Does Ferret have problems with #alias_method_chain ?
Hi all, I have this in my class: class Party < AR::B acts_as_ferret :store_class_name => true, :remote => true, :fields => (self.content_columns.map(&:name) rescue []) + %w(main_identifier) class << self # #count is also defined, omitted for clarity def find_with_destroyed_scope(*args) with_destroyed_scope do
2006 Aug 16
0
acts_as_paranoid and alias_method_chain
when i require acts_as_paranoid I''m getting: undefined method `alias_method_chain'' for #<Class:ActiveRecord::Base> (NoMethodError) It happens in acts_as_paranoid''s init.rb. here''s the whole file. the alias_method_chain is near the bottom. please advise. class << ActiveRecord::Base def belongs_to_with_deleted(association_id, options = {})
2006 Mar 29
0
Intermittent error - undefined method ''destroy_without_callbacks''
When testing my app locally I''m getting intermittent errors which are driving me mad! The error is: NameError ((eval):1:in `alias_method'': undefined method `destroy_without_callbacks'' for class `Exercise''): Refreshing the browser sometimes fixes it, as does restarting WEBrick. Annoying to debug as it only happens intermittently. Any ideas on why this is
2009 Oct 21
3
alias_method_chain and ActiveSupport::TestCase
I''m trying to add some functionality to the setup method of all my tests. I added a method called setup_with_ts in the test_helper and chained it using alias_method_chain :setup, :ts and that works great for every test that does not define setup in the test. So for my unit tests i tried also defining the same method setup_with_ts in a class ActiveSupport::TestCase def setup_with_ts
2012 Jul 21
0
undefined method `scope' for non ActiveRecord class
I am trying to use the geocoding capabilities into a table less model , but the method :scope is not defined .. is there a way to include it ? class SearchLocation require ''geocoder'' include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming extend Geocoder::Model::ActiveRecord # extending the class w geocoding capaibilities ( from
2010 Jul 23
0
alias_method_chain with i18n
Hello, I was investigating solutions for i18n with will_paginate and I found a possible solution at http://lawrencesong.net/2009/01/enable-i18n-in-will_paginate-plugin/ The author adds to application_helper.rb the following code: ############################################# include WillPaginate::ViewHelpers def will_paginate_with_i18n(collection, options = {})
2008 Dec 17
9
Rails 2.2.2 and globalize - undefined method `render_file' for class `ActionView::Base' (NameError)
Looks like globalize (1.2) is not compatible with rails 2.2.2. I am getting: '' => Booting Mongrel (use ''script/server webrick'' to force WEBrick) => Rails 2.2.2 application starting on http://0.0.0.0:3003 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3003 ** Starting Rails with development environment...
2007 Aug 30
1
alias_method_chain stack level too deep in Rake test only
I have an odd error. I have the following module: module ActionController module SslSupport def self.included(base) raise "#{base} does not define url_for" unless base.method_defined?(:url_for) unless base.respond_to?(:url_for_without_ssl_supprt) base.send :include, InstanceMethods base.send :alias_method_chain, :url_for, :ssl_support end
2014 Apr 06
0
undefined local variable or method `message' (NameError)
I am trying to learn Rspec-Cucumber tutorial by referring to "The Pragmatic Programmers - The Rspec Book". I am on the 4th chapter and seems to be stuck with an error and not able to move forward.I have followed exactly as per the tutorial but it is showing the below error `( in line : output.messages.should include(message))`when I try to run cucumber feature in my console. **undefined
2009 Aug 31
3
NameError: undefined local variable or method `testapp' for main:Object
Hi, I am new to Ruby on Rails. Recently, I downloaded and installed the InstantRails in the D:\ drive of my system. Now I wanted to try some small examples in ''irb'', so I created a file "testapp.rb" and in that pasted a code like this: ======================== class sample_class def sample_method puts "sample program" end
2008 Nov 19
3
Mock today
In some of my unit tests, I find the need to set today to a different value than the actual today. For example, to test the model method "balance_of_today", which takes no argument, I want to have Date.today be a specific date for the purpose of testing. In other words, I want to do something like this: mock_today(Date.new(2008, 2, 1)) do ... test code... end My implementation for
2009 Mar 22
1
Upgrading 2.2 to 2.3: console broken, "uninitialized constant Module::ActiveSupport"
Upgrading a Rails app from 2.2 to 2.3.2 (via 2.3.0). Got things working in the browser, but script/console seems messed up in both 2.3.0 and 2.3.2: $ script/console Loading development environment (Rails 2.3.2) /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:56:in `env'':NameError: uninitialized constant Module::ActiveSupport
2008 Feb 21
1
polymorphic has_many from ActiveRecord::Base????
I have a polymorphic thingy called fields and I need to on each and every model, so I''d like to do the has_many from the base class, like this... ActiveRecord::Base.class_eval do has_many :fields, :as => :model, :dependent => true end It fails with this no method error (class_of_active_record_descendant) /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.6/lib/active_record/