This project is archived and is in readonly mode.
NoMethodError when using 'class_attribute'
Reported by Chris Sepic | June 9th, 2010 @ 06:04 PM
require "active_support/all" # or /core_ext
Class Foo; class_attribute :bar; end # raises NoMethodError
Comments and changes to this ticket
-
Neeraj Singh June 9th, 2010 @ 07:41 PM
How is your project setup? Can you elaborate on that. Thanks.
-
Chris Sepic June 9th, 2010 @ 08:54 PM
Neeraj - I'm just requiring the latest activesupport (activesupport-3.0.0.beta4) in irb:
irb(main):001:0> gem "activesupport", "3.0.0.beta4" => true irb(main):002:0> require "active_support/core_ext" => true irb(main):003:0> class Foo; class_attribute :bar; end NoMethodError: undefined method `class_attribute' for Foo:Class from (irb):3:in `<class:Foo>' from (irb):3 from /Users/csepic/.rvm/rubies/ruby-1.9.1-p378/bin/irb:15:in `<main>' irb(main):004:0>
-
Chris Sepic June 9th, 2010 @ 08:56 PM
Looking in class.rb, there is simply no "require" for attribute.rb. I don't know if there is a reason for this.
-
Prem Sichanugrist (sikachu) June 11th, 2010 @ 12:48 AM
- State changed from new to verified
- Assigned user set to Yehuda Katz (wycats)
You're definitely right, here is the patch for it.
-
Prem Sichanugrist (sikachu) September 10th, 2010 @ 01:44 PM
- State changed from verified to resolved
- Importance changed from to Low
This ticket was resolved a while ago, but seems like José forgot to add # in commit message!
http://github.com/rails/rails/commit/6c4bab306ae1ee47b7fe5933867d32...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>