diff options
Diffstat (limited to 'activemodel')
-rw-r--r-- | activemodel/CHANGELOG | 7 | ||||
-rwxr-xr-x[-rw-r--r--] | activemodel/Rakefile | 0 | ||||
-rw-r--r-- | activemodel/activemodel.gemspec | 4 | ||||
-rw-r--r-- | activemodel/lib/active_model/attribute_methods.rb | 14 | ||||
-rw-r--r-- | activemodel/lib/active_model/naming.rb | 1 | ||||
-rw-r--r-- | activemodel/lib/active_model/version.rb | 4 | ||||
-rw-r--r-- | activemodel/test/cases/helper.rb | 6 | ||||
-rw-r--r-- | activemodel/test/cases/serializeration/xml_serialization_test.rb | 7 |
8 files changed, 26 insertions, 17 deletions
diff --git a/activemodel/CHANGELOG b/activemodel/CHANGELOG index 9c65778b59..4e963c77b0 100644 --- a/activemodel/CHANGELOG +++ b/activemodel/CHANGELOG @@ -2,6 +2,13 @@ * No changes +*Rails 3.0.2 (unreleased)* + +* No changes + +*Rails 3.0.1 (October 15, 2010)* + +* No Changes, just a version bump. *Rails 3.0.0 (August 29, 2010)* diff --git a/activemodel/Rakefile b/activemodel/Rakefile index 0372c7a03e..0372c7a03e 100644..100755 --- a/activemodel/Rakefile +++ b/activemodel/Rakefile diff --git a/activemodel/activemodel.gemspec b/activemodel/activemodel.gemspec index c483ecbc3c..318d71a610 100644 --- a/activemodel/activemodel.gemspec +++ b/activemodel/activemodel.gemspec @@ -20,6 +20,6 @@ Gem::Specification.new do |s| s.has_rdoc = true s.add_dependency('activesupport', version) - s.add_dependency('builder', '~> 2.1.2') - s.add_dependency('i18n', '~> 0.4.1') + s.add_dependency('builder', '~> 3.0.0') + s.add_dependency('i18n', '~> 0.4.2') end diff --git a/activemodel/lib/active_model/attribute_methods.rb b/activemodel/lib/active_model/attribute_methods.rb index 44e3e64a9e..fc5f5c4c66 100644 --- a/activemodel/lib/active_model/attribute_methods.rb +++ b/activemodel/lib/active_model/attribute_methods.rb @@ -46,8 +46,8 @@ module ActiveModel # end # end # - # Notice that whenever you include ActiveModel::AttributeMethods in your class, - # it requires you to implement a <tt>attributes</tt> methods which returns a hash + # Note that whenever you include ActiveModel::AttributeMethods in your class, + # it requires you to implement an <tt>attributes</tt> method which returns a hash # with each attribute name in your model as hash key and the attribute value as # hash value. # @@ -98,10 +98,10 @@ module ActiveModel def define_attr_method(name, value=nil, &block) sing = singleton_class sing.class_eval <<-eorb, __FILE__, __LINE__ + 1 - if method_defined?(:original_#{name}) - undef :original_#{name} + if method_defined?(:'original_#{name}') + undef :'original_#{name}' end - alias_method :original_#{name}, :#{name} + alias_method :'original_#{name}', :'#{name}' eorb if block_given? sing.send :define_method, name, &block @@ -274,8 +274,8 @@ module ActiveModel method_name = matcher.method_name(attr_name) generated_attribute_methods.module_eval <<-STR, __FILE__, __LINE__ + 1 - if method_defined?(:#{method_name}) - undef :#{method_name} + if method_defined?(:'#{method_name}') + undef :'#{method_name}' end def #{method_name}(*args) send(:#{matcher.method_missing_target}, '#{attr_name}', *args) diff --git a/activemodel/lib/active_model/naming.rb b/activemodel/lib/active_model/naming.rb index adb71f788f..44aedc8efd 100644 --- a/activemodel/lib/active_model/naming.rb +++ b/activemodel/lib/active_model/naming.rb @@ -1,5 +1,6 @@ require 'active_support/inflector' require 'active_support/core_ext/hash/except' +require 'active_support/core_ext/module/introspection' module ActiveModel class Name < String diff --git a/activemodel/lib/active_model/version.rb b/activemodel/lib/active_model/version.rb index ece4431225..23ba42bf35 100644 --- a/activemodel/lib/active_model/version.rb +++ b/activemodel/lib/active_model/version.rb @@ -3,8 +3,8 @@ module ActiveModel MAJOR = 3 MINOR = 1 TINY = 0 - BUILD = "beta" + PRE = "beta" - STRING = [MAJOR, MINOR, TINY, BUILD].join('.') + STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.') end end diff --git a/activemodel/test/cases/helper.rb b/activemodel/test/cases/helper.rb index a81584bbad..01f0158678 100644 --- a/activemodel/test/cases/helper.rb +++ b/activemodel/test/cases/helper.rb @@ -12,9 +12,3 @@ ActiveSupport::Deprecation.debug = true require 'rubygems' require 'test/unit' - -begin - require 'ruby-debug' - Debugger.start -rescue LoadError -end diff --git a/activemodel/test/cases/serializeration/xml_serialization_test.rb b/activemodel/test/cases/serializeration/xml_serialization_test.rb index ff786658b7..cc19d322b3 100644 --- a/activemodel/test/cases/serializeration/xml_serialization_test.rb +++ b/activemodel/test/cases/serializeration/xml_serialization_test.rb @@ -70,6 +70,13 @@ class XmlSerializationTest < ActiveModel::TestCase assert_match %r{<CreatedAt}, @xml end + test "should allow lower-camelized tags" do + @xml = @contact.to_xml :root => 'xml_contact', :camelize => :lower + assert_match %r{^<xmlContact>}, @xml + assert_match %r{</xmlContact>$}, @xml + assert_match %r{<createdAt}, @xml + end + test "should allow skipped types" do @xml = @contact.to_xml :skip_types => true assert_match %r{<age>25</age>}, @xml |