Displaying 20 results from an estimated 600 matches similar to: "alias_method_chain and ActiveSupport::TestCase"
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:
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
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 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
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
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
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
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 = {})
2007 Mar 22
0
`alias_method_chain': undefined method `find' for class `ActiveRecord::Base' (NameError)
I can''t seem to be able to override the :find method in the model base
class, for example, in /lib/usermonitor.rb:
module ActiveRecord
module UserMonitor
def self.included(base)
base.class_eval do
alias_method_chain :find, :user
def current_site
Thread.current[:user]
end
end
end
def find_with_user(*args)
...
end
end
2009 Apr 08
3
Rails 2.3 memcache performance drop
After much effort I upgraded our fairly large Rails app from 2.1 to
2.3. After deployment yesterday I noticed an across the board
increase in response times. It seems that every call to memcache now
takes 10x longer than before. Here are some example numbers from my
development log (below), with memcache running locally. We see
similar scale of performance drop in production as well - average
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 Nov 23
4
Strange behavior of alias_method_chains
Greetings.
I''ve got very strange behavior of alias_method_chains, and I hope
someone will advise me.
I have a rails 2.2.2 app created with
#rails aliasApp
, a class XYZ residing in app/helpers/xyz.rb:
<code>
class XYZ
attr_accessor :name
attr_accessor :value
def initialize (a, b)
puts "in XYZ constructor"
self.name = a
self.value = b
end
def a
2011 Apr 08
5
How to extend a helper using plugin?
Hello,
I''m facing this problem while trying to extend the parse_redmine_links
helper method in Redmine-1.1.0 (Rails-2.3.5) from my plugin.
My idea is to use alias_method_chain so the extended version could
call the original version and adjust the result to it''s liking.
Anything I''ve tried so far exposes this behavior: the first render of
a page uses the extended
2009 Aug 17
1
Problem with setter override on ActiveRecord
(This message was originally written on StackOverflow -- the
formatting is much prettier there --
http://stackoverflow.com/questions/1283046/problem-with-setter-override-on-activerecord)
This is not exactly a question, it''s rather a report on how I solved
an issue with write_attribute when the attribute is an object, on
Rails'' Active Record. I hope this can be useful to others
2006 Jun 15
1
Unicode hacks - problem
I have updated to latest Unicode hacks plugin and now it fails when
rails are started ....
C:\ruby_projects\radrails\workspace\auth_template>mongrel_rails start
** Starting Mongrel in development mode at 0.0.0.0:3000
** Starting Rails in environment development ...
C:/ruby_projects/radrails/workspace/auth_template/config/../vendor/plugins/scoped_access/init.rb:17:in
2009 Nov 10
10
Un-recognised routes that do exist, using namespaces & subdomain checking
I''m getting really cheesed off with RSpec not matching some of my
routes when controller testing when I have subdomain checking
(courtesy of subdomain-fu) on namespaces. These routes appear in the
rake routes output, and work fine via HTTP requests .
The really annoying thing is it''s working fine for routes that aren''t
at the root of the namespace.
E.g. say I have
2012 Sep 25
3
Proposal for a new ActiveModel::Errors structure
There are few issues with the current ActiveModel::Errors class.
Firstly, when an error is added to ActiveModel::Errors class via #add
method
(https://github.com/rails/rails/blob/master/activemodel/lib/active_model/errors.rb#L294)
its translation is added. It should not be translated when being added, but
only when being read.
The second issue is a bit bigger. We''d like to create
2009 May 06
1
How to extend ActionMailer
I wish to extend ActionMailer::Base by method chaining a class instance
variable:
module ActionMailer
class Base
class << self
def method_name
...
What is the magic incantation to accomplish this?
I cannot get this to work with action mailer:
module MyMethods
def self.include(base)
base.alias_method_chain :method_name, :my_method
def
2010 Jul 30
1
[PATCH 1/2] Monkey-patch mongrel to fix rails 2.3.5 incompatibility
Signed-off-by: Nicolas Ochem <nicolas.ochem at alcatel-lucent.com>
---
src/config/initializers/mongrel_patch.rb | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
create mode 100644 src/config/initializers/mongrel_patch.rb
diff --git a/src/config/initializers/mongrel_patch.rb
b/src/config/initializers/mongrel_patch.rb
new file mode 100644
index 0000000..ae2bcf4
---