Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge remote-tracking branch ↵ | Jon Leighton | 2014-02-25 | 1 | -11/+19 |
|\ | | | | | | | | | | | | | 'chancancode/fix_instance_method_already_implemented' Conflicts: activerecord/CHANGELOG.md | ||||
| * | Fixed STI classes not defining an attribute method if there is a | Godfrey Chan | 2014-02-23 | 1 | -11/+19 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conflicting private method defined on its ancestors. The problem is that `method_defined_within?(name, klass, superklass)` only works correclty when `klass` and `superklass` are both `Class`es. If both `klass` and `superklass` are both `Class`es, they share the same inheritance chain, so if a method is defined on `klass` but not `superklass`, this method must be introduced at some point between `klass` and `superklass`. This does not work when `superklass` is a `Module`. A `Module`'s inheritance chain contains just itself. So if a method is defined on `klass` but not on `superklass`, the method could still be defined somewhere upstream, e.g. in `Object`. This fix works by avoiding calling `method_defined_within?` with a module while still fufilling the requirement (checking that the method is defined withing `superclass` but not is not a generated attribute method). 4d8ee288 is likely an attempted partial fix for this problem. This unrolls that fix and properly check the `superclass` as intended. Fixes #11569. | ||||
* | | Coerce strings when reading attributes. | Yves Senn | 2014-02-23 | 1 | -0/+18 |
|/ | |||||
* | Fix AR#method_missing re-dispatching into overwritten attribute methods. | thedarkone | 2013-09-29 | 1 | -2/+33 |
| | | | | | | | | | | | | | | This was happening when a `super` call in an overwritten attribute method was triggering a method_missing fallback, because attribute methods haven't been generated yet. class Topic < ActiveRecord::Base def title # `super` would re-invoke this method if define_attribute_methods # hasn't been called yet resulting in double '!' appending super + '!' end end | ||||
* | Merge pull request #9860 from wangjohn/update_attributes_throws_error_with_nil | Rafael Mendonça França | 2013-09-24 | 1 | -1/+1 |
|\ | | | | | | | | | | | | | Raising an error when nil is passed to update_attributes. Conflicts: activerecord/CHANGELOG.md | ||||
| * | Raising an error when nil or non-hash is passed to update_attributes. | wangjohn | 2013-06-25 | 1 | -1/+1 |
| | | |||||
* | | Remove deprecation warning from attribute_missing | Arun Agrawal | 2013-07-15 | 1 | -15/+0 |
| | | | | | | for attributes that are columns. | ||||
* | | Fix: attribute_for_inspect truncate upto (51 => 50) characters. | namusyaka | 2013-07-09 | 1 | -1/+1 |
|/ | |||||
* | Extract AR::AttributeMethods#attribute_for_inspect's test code out from ↵ | Takehiro Adachi | 2013-05-22 | 1 | -0/+8 |
| | | | | | | | base_test.rb The method itself got extracted out from ActiveRecored::Base in commit ceb33f84933639d3b61aac62e5e71fd087ab65ed, but the test code never did. | ||||
* | test refactor | Aaron Patterson | 2013-05-16 | 1 | -5/+2 |
| | |||||
* | Add more data to AR::UnknownAttributeError | Bogdan Gusiev | 2013-05-16 | 1 | -0/+12 |
| | | | | | | | | | begin Topic.new("hello" => "world") rescue ActiveRecord::UnknownAttributeError => e e.record # => #<Topic ... > e.attribute # => "hello" end | ||||
* | read_attribute_before_type_cast should accept symbol | Neeraj Singh | 2013-05-11 | 1 | -0/+1 |
| | |||||
* | fixes a test, and explains why AR::AttributeMethods checks ↵ | Xavier Noria | 2013-04-28 | 1 | -5/+2 |
| | | | | defined?(@attributes) in some places | ||||
* | Removed space and unused class | Anupam Choudhury | 2013-04-06 | 1 | -1/+1 |
| | |||||
* | fix typos in AR. lots of them. | Vipul A M | 2013-03-19 | 1 | -2/+2 |
| | |||||
* | Remove not used require and some useless test comments | Carlos Antonio da Silva | 2012-11-17 | 1 | -12/+3 |
| | |||||
* | Fix typo in module name and make #in_time_zone private | Carlos Antonio da Silva | 2012-11-17 | 1 | -1/+1 |
| | |||||
* | Extract #in_time_zone helper method duplication to a module | Carlos Antonio da Silva | 2012-11-17 | 1 | -12/+2 |
| | |||||
* | Simplify helper method in attribute methods test | Carlos Antonio da Silva | 2012-11-17 | 1 | -3/+1 |
| | |||||
* | AR::AttributeMethods#[] raises AM::AttributeMissingError for missing attributes. | Francesco Rodriguez | 2012-10-28 | 1 | -0/+6 |
| | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following behaviour: class Person < ActiveRecord::Base belongs_to :company end # Before: person = Person.select('id').first person[:name] # => nil person.name # => ActiveModel::MissingAttributeError: missing_attribute: name person[:company_id] # => nil person.company # => nil # After: person = Person.select('id').first person[:name] # => ActiveModel::MissingAttributeError: missing_attribute: name person.name # => ActiveModel::MissingAttributeError: missing_attribute: name person[:company_id] # => ActiveModel::MissingAttributeError: missing_attribute: company_id person.company # => ActiveModel::MissingAttributeError: missing_attribute: company_id Fixes #5433. | ||||
* | Revert "Key the attributes hash with symbols" | Jon Leighton | 2012-10-12 | 1 | -2/+2 |
| | | | | | | | | | | | | This reverts commit 86c3dfbd47cb96af02daaa655963292b1a1b110e. Conflicts: activerecord/lib/active_record/attribute_methods/read.rb Reason: whilst this increased performance, it also presents a DoS risk via memory exhaustion if users were allowing user input to dictate the arguments of read/write_attribute. I will investigate alternative ways to cut down on string allocations here. | ||||
* | test cleanup, remove ruby_type because it's no longer needed | Yves Senn | 2012-09-03 | 1 | -1/+1 |
| | | | | | All tests with a custom inheritance_column use the `Vegtable` model. The field ruby_type on the Company models is no longer needed | ||||
* | Key the attributes hash with symbols | Jon Leighton | 2012-08-31 | 1 | -2/+2 |
| | | | | | | | | This is a performance/GC optimisation. In theory, this could be optimised by the implementation (last time I checked, this would have no effect on JRuby). But in practise, this make attribute access faster. | ||||
* | Move the serialized attribute tests to their own file | Rafael Mendonça França | 2012-08-26 | 1 | -11/+0 |
| | |||||
* | Move test to the correct file | Rafael Mendonça França | 2012-08-26 | 1 | -0/+6 |
| | |||||
* | Refactor missing parameter validation based on position | Carlos Antonio da Silva | 2012-08-18 | 1 | -1/+0 |
| | |||||
* | load active_support/core_ext/object/inclusion in active_support/rails | Xavier Noria | 2012-08-02 | 1 | -1/+0 |
| | |||||
* | Deprecate ActiveRecord::Base.scoped. | Jon Leighton | 2012-07-27 | 1 | -4/+4 |
| | | | | | | | It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders. | ||||
* | Fix class_eval without __FILE__ and __LINE__. | kennyj | 2012-07-18 | 1 | -1/+1 |
| | |||||
* | Move newly added multiparameter tests to base_test file | Carlos Antonio da Silva | 2012-06-28 | 1 | -35/+1 |
| | | | | | All other multiparameter assignment tests are in the same file, so it makes sense to have all of them here. | ||||
* | Skip test_setting_time_attribute because Oracle database | Yasuo Honda | 2012-06-28 | 1 | -0/+2 |
| | | | | does not have TIME data type. | ||||
* | Fixes #6825, adds tests covering cases and error possibilities, also changes ↵ | Mauricio Linhares | 2012-06-27 | 1 | -0/+33 |
| | | | | SQLite3 driver to correctly generate a time column instead of datetime | ||||
* | Remove unused assignments from activerecord tests | Mark Rushakoff | 2012-04-29 | 1 | -2/+2 |
| | |||||
* | %s/find(:\(first\|last\|all\), \([^()]*\))/scoped(\2).\1/gcI amongst other ↵ | Jon Leighton | 2012-04-27 | 1 | -4/+4 |
| | | | | things | ||||
* | remove calls to find(:first), find(:last) and find(:all) | Jon Leighton | 2012-04-26 | 1 | -1/+1 |
| | |||||
* | attribute_present? should return false for empty strings | Jacob Green | 2012-03-06 | 1 | -0/+3 |
| | |||||
* | Fix warning: assigned but unused variable | kennyj | 2012-03-01 | 1 | -3/+0 |
| | |||||
* | force datetime attributes to be changed, fix GH #3965 | Sergey Nartimov | 2012-02-28 | 1 | -0/+13 |
| | |||||
* | move id_before_type_cast to PrimaryKey module | Sergey Nartimov | 2012-02-16 | 1 | -0/+8 |
| | |||||
* | Revert PR#5001 "removed unuseful require for reply as we are not using ↵ | Vishnu Atrai | 2012-02-12 | 1 | -0/+1 |
| | | | | | | require model" This reverts commit 7381596ea32aff47222af89e4bc66000f4597acb. | ||||
* | removed unuseful require for reply as we are not using require model | Karunakar (Ruby) | 2012-02-11 | 1 | -1/+0 |
| | |||||
* | fixing the list of cached columns | Aaron Patterson | 2012-02-09 | 1 | -1/+3 |
| | |||||
* | only exclude serialized columns from cacheable columns | Aaron Patterson | 2012-02-09 | 1 | -1/+1 |
| | |||||
* | Test that #[] and #[]= keep working when #read_attribute and ↵ | Tom Stuart | 2012-01-11 | 1 | -0/+33 |
| | | | | #write_attribute are overridden | ||||
* | Test ActiveRecord::Base#[]= as well as #write_attribute | Tom Stuart | 2012-01-11 | 1 | -1/+7 |
| | |||||
* | Fix #4046. | Jon Leighton | 2011-12-23 | 1 | -0/+20 |
| | |||||
* | remove deprecated underscore versions of attribute methods | Sergey Nartimov | 2011-12-21 | 1 | -8/+0 |
| | |||||
* | handle not only strings in date type cast | Sergey Nartimov | 2011-12-19 | 1 | -0/+8 |
| | |||||
* | Stop the build asploding on 1.8.7 | Jon Leighton | 2011-12-14 | 1 | -0/+4 |
| | |||||
* | Fix #3837. | Jon Leighton | 2011-12-03 | 1 | -0/+12 |
| | | | | | We also need to time zone convert time zone aware attributes when accessed via read_attribute, not only when via direct access. |