diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/CHANGELOG | 9 | ||||
-rw-r--r-- | activesupport/activesupport.gemspec | 1 | ||||
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/attribute.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/version.rb | 2 | ||||
-rw-r--r-- | activesupport/test/core_ext/class/attribute_test.rb | 6 |
5 files changed, 16 insertions, 4 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index 3822abcab6..b9f565c71d 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,4 +1,9 @@ -*Rails 3.0 (pending)* +*Rails 3.0.0 [beta 2] (April 1st, 2010)* + +* Reduced load time by deferring configuration of classes using + ActiveSupport::on_load(:component_name) [YK] + +* Rename #metaclass to #singleton_class now that ruby-core has decided [JK] * New assertions assert_blank and assert_present. #4299 [Juanjo Bazan] @@ -7,7 +12,7 @@ * JSON backend for YAJL. Preferred if available. #2666 [Brian Lopez] -*Rails 3.0.0 [beta] (February 4, 2010)* +*Rails 3.0.0 [beta 1] (February 4, 2010)* * Introduce class_attribute to declare inheritable class attributes. Writing an attribute on a subclass behaves just like overriding the superclass reader method. Unifies and replaces most usage of cattr_accessor, class_inheritable_attribute, superclass_delegating_attribute, and extlib_inheritable_attribute. [Jeremy Kemper, Yehuda Katz] diff --git a/activesupport/activesupport.gemspec b/activesupport/activesupport.gemspec index bfb1e83002..ad1401bfa9 100644 --- a/activesupport/activesupport.gemspec +++ b/activesupport/activesupport.gemspec @@ -6,6 +6,7 @@ Gem::Specification.new do |s| s.version = version s.summary = 'A toolkit of support libraries and Ruby core extensions extracted from the Rails framework.' s.description = 'A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. Rich support for multibyte strings, internationalization, time zones, and testing.' + s.required_ruby_version = '>= 1.8.7' s.author = 'David Heinemeier Hansson' diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb index 9631a7d242..577d5cbf45 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute.rb +++ b/activesupport/lib/active_support/core_ext/class/attribute.rb @@ -50,7 +50,7 @@ class Class singleton_class.send(:define_method, attr) { value } end - define_method(attr) { self.class.send(attr) } + define_method(attr) { self.singleton_class.send(attr) } define_method(:"#{attr}?") { !!send(attr) } define_method(:"#{attr}=") do |value| singleton_class.remove_possible_method(attr) diff --git a/activesupport/lib/active_support/version.rb b/activesupport/lib/active_support/version.rb index 831204693f..3ce11e59d2 100644 --- a/activesupport/lib/active_support/version.rb +++ b/activesupport/lib/active_support/version.rb @@ -3,7 +3,7 @@ module ActiveSupport MAJOR = 3 MINOR = 0 TINY = 0 - BUILD = "beta1" + BUILD = "beta2" STRING = [MAJOR, MINOR, TINY, BUILD].join('.') end diff --git a/activesupport/test/core_ext/class/attribute_test.rb b/activesupport/test/core_ext/class/attribute_test.rb index 06b4cf075f..24aa5c0eba 100644 --- a/activesupport/test/core_ext/class/attribute_test.rb +++ b/activesupport/test/core_ext/class/attribute_test.rb @@ -59,4 +59,10 @@ class ClassAttributeTest < ActiveSupport::TestCase object = Class.new { class_attribute :setting, :instance_writer => false }.new assert_raise(NoMethodError) { object.setting = 'boom' } end + + test 'works well with singleton classes' do + object = @klass.new + object.singleton_class.setting = 'foo' + assert_equal 'foo', object.setting + end end |