search for: read_inheritable_attribute

Displaying 14 results from an estimated 14 matches for "read_inheritable_attribute".

2006 Apr 25
2
Bug in Rails 1.1 implementation of before_filters
...istered, but I was using them *during* the registration process to figure out how to manipulate the filter chain. Since Rails 1.1 caches their value the first time they''re called, their return value is out of date if more filters are added. A workaround is to bypass the cache and use read_inheritable_attribute("before_filters") instead of before_filters. Similarly, use read_inheritable_attribute("included_actions") instead of included_actions. This is bad because now my code is tied to an implementation detail which would normally be hidden. Incidentally, the same bug also occurs...
2006 Aug 01
8
Decoupled observers for controllers?
In the Rails Recipes book the recipe "Keeping track of who did what" explains how to do decoupled observing of models. In my application I''d like to do a similar thing but watching the controllers. For example, when somebody hits the login method of the Security controller, I''d like to make a note of it. In this case I could observe the User model and watch for
2007 Mar 13
1
Using ActiveRecord outside of Rails error
...s using ActiveRecord for database queries outside of a rails app. It seems to work fine for doing finds on models, but everytime I try to create a new model object and then save it, I always get the error: MyModel.new({:name=>''foo''}).save gives NoMethodError: undefined method `read_inheritable_attribute'' for #<MyModel:0x251f7d8> I''ve got a require for active_support. Is there anything else I have to do to get this to work? Thanks, Ray -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you ar...
2007 Jan 06
6
Exception notifier not working
...ts locally, I commented out the code in ExceptionNotifiable as such: def local_request? # remote = IPAddr.new(request.remote_ip) # !self.class.local_addresses.detect { |addr| addr.include?(remote) }.nil? false end ...and I''ve also tried: def local_addresses ''addresses = read_inheritable_attribute(:local_addresses) unless addresses addresses = [IPAddr.new("127.0.0.1")] write_inheritable_attribute(:local_addresses, addresses) end addresses'' nil end The README says to override the does-not-work-locally by putting "local_addresses.cle...
2008 Jan 07
2
acts_as_state_machine override :initial state
Hello, I''m not sure if this is where to post this, but i cannot find much information/support for acts_as_state_machine. I have a Friendship model which implements acts_as_state_machine. I have an :initial state of :pending, but i would like to create a Friendship model and save it directly with :accepted status. I have tried Friendship.create(:state => "accepted") and
2006 Aug 15
0
SystemStackError: stack level too deep
...s << KeywordResult.new({:title => "foobar", :url => "foobar"}) SystemStackError: stack level too deep from ./script/../config/../config/../vendor/rails/activerecord/lib/../../activesupport/lib/active_support/core_ext/class/inheritable_attributes.rb:100:in `read_inheritable_attribute'' from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/callbacks.rb:354:in `callbacks_for'' from ./script/../config/../config/../vendor/rails/activerecord/lib/active_record/callbacks.rb:330:in `callback'' from ./script...
2006 Jan 06
0
Rails ActionWebService and gSOAP interoperability problem
...ows that things fall over when decoding the action pack request. If it tried SOAP first, that wouldn''t be a problem. Or if it tried to grok XML RPC and failed, it should have fallen back to SOAP? > def discover_web_service_request(action_pack_request) > (self.class.read_inheritable_attribute > ("web_service_protocols") || []).each do |protocol| > protocol = protocol.create(self) > request = protocol.decode_action_pack_request > (action_pack_request) > return request unless request.nil? > end >...
2006 Jan 07
0
gSOAP and ActionWebService interop problems
...scovery.rb shows that things fall over when decoding the action pack request. If it tried SOAP first, that wouldn''t be a problem. Or if it tried to grok XML RPC and failed, it should have fallen back to SOAP? def discover_web_service_request(action_pack_request) (self.class.read_inheritable_attribute("web_service_protocols") || []).each do |protocol| protocol = protocol.create(self) request = protocol.decode_action_pack_request(action_pack_request) return request unless request.nil? end nil end Ideally, I''d...
2007 Sep 05
2
after_create callback called twice in test env when using fixtures
All, I''ve been trying to figure out a strange bug in one of my applications that I think I''ve narrowed down to a problem with rails fixtures. It seems as though the after_create callback is being run twice when I save a record. This is only happening a) in the test environment, and b) when there is a fixture file for that table. The test below only prints "Doing
2006 Jul 05
2
Serialized object behaves weird
Hi! I got a class named EinsatzFilter which I serialized to session. Before saving to session it works afterwards I keep getting the message: "undefined method `to_s'' for #<Person:0x38c6ab8>". "Person" is a from ActiveRecord::Base inherited class. Code: class EinsatzFilter include ApplicationHelper attr_reader :personen, :monat, :projekte, :kunde
2006 Apr 26
0
Re: gSOAP and ActionWebService interop problems
...er when decoding the > action pack request. If it tried SOAP first, that wouldn''t be a > problem. Or if it tried to grok XML RPC and failed, it should have > fallen back to SOAP? > > > def discover_web_service_request(action_pack_request) > > (self.class.read_inheritable_attribute > > ("web_service_protocols") || []).each do |protocol| > > protocol = protocol.create(self) > > request = protocol.decode_action_pack_request > > (action_pack_request) > > return request unless request.nil? > >...
2006 Feb 07
11
Possible Rails Security Issue?
I have an e-commerce site and users check out with a form. The results of that form are sent to a "confirm your order" page via POST. I take great pains to NEVER store the full credit card number on my server--just the last 4 digits. I was very surprised to find that by default Rails will record POST requests with parameters in the production.log. And those parameters
2006 Jul 27
9
Introspecting validates_presence_of
Hello people, I''d like to detect whether an attribute of a model has vaildates_presence_of applied to it so I can automatically apply a mandatory (*) to the field...it doesn''t look easy...any ideas? Cheers, -- Dan Webb http://www.danwebb.net
2007 Sep 18
10
Routes
hi all, I want to move some routing tasks out of the router and into the controller. The goal is to make Merb feel less like mod_rewrite and give the user more control at the controller. The new Router is simple: it takes the path_info (not the whole request) then outputs a controller class and some parameters from the path matching. The rest of the routing would be done at the controller level.