diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-01 19:22:16 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-01 19:22:16 +0000 |
commit | daf3e92a316c041b6b2bf331c8d2a51e710fe7bf (patch) | |
tree | ca492afaf76db59ec1ab99105c07b54ffb28cc6a /activerecord/lib/active_record/base.rb | |
parent | a6fefad354d36f3e9a91f8582659ffcda1a35855 (diff) | |
download | rails-daf3e92a316c041b6b2bf331c8d2a51e710fe7bf.tar.gz rails-daf3e92a316c041b6b2bf331c8d2a51e710fe7bf.tar.bz2 rails-daf3e92a316c041b6b2bf331c8d2a51e710fe7bf.zip |
Added a db2 adapter that only depends on the Ruby/DB2 bindings (http://raa.ruby-lang.org/project/ruby-db2/) #386 [Maik Schmidt]. Converted all the fixtures to YAML style ones.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@303 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 849fb1578b..284f06c694 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -311,7 +311,7 @@ module ActiveRecord #:nodoc: sql << "ORDER BY #{orderings} " unless orderings.nil? connection.add_limit!(sql, 1) - + record = connection.select_one(sql, "#{name} Load First") instantiate(record) unless record.nil? end @@ -919,7 +919,7 @@ module ActiveRecord #:nodoc: # table with a master_id foreign key can instantiate master through Client#master. def method_missing(method_id, *arguments) method_name = method_id.id2name - + if method_name =~ read_method? && @attributes.include?($1) return read_attribute($1) elsif method_name =~ read_untyped_method? && @attributes.include?($1) @@ -959,7 +959,7 @@ module ActiveRecord #:nodoc: # Returns true if the attribute is of a text column and marked for serialization. def unserializable_attribute?(attr_name, column) - @attributes[attr_name] && column.send(:type) == :text && @attributes[attr_name].is_a?(String) && self.class.serialized_attributes[attr_name] + @attributes[attr_name] && [:text, :string].include?(column.send(:type)) && @attributes[attr_name].is_a?(String) && self.class.serialized_attributes[attr_name] end # Returns the unserialized object of the attribute. |