Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge pull request #4487 from sarenji/fix-reset-counters | Aaron Patterson | 2012-01-17 | 2 | -0/+8 |
| | | | | Fix bug where reset_counters resets the wrong counter cache. | ||||
* | serialize fails on subclass | Alvaro Bautista | 2011-12-23 | 1 | -0/+4 |
| | |||||
* | added failing tests for has_many, has_one and belongs_to associations with ↵ | Jakub Kuźma | 2011-12-21 | 1 | -2/+2 |
| | | | | | | strict mass assignment sanitizer, fixed build_record to not merge creation_attributes, removed failing nested attributes tests (that feature was broken anyway) #4051 Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | call scope within unscoped to prevent duplication of where values | Sergey Nartimov | 2011-12-17 | 1 | -0/+2 |
| | |||||
* | Allow nested attributes in associations to update values in it's owner ↵ | Andrew Kaspick | 2011-12-14 | 1 | -1/+4 |
| | | | | object. Fixes a regression from 3.0.x | ||||
* | Fix #3890. (Calling proxy_association in scope chain.) | Jon Leighton | 2011-12-08 | 1 | -1/+5 |
| | |||||
* | Deprecate set_locking_column in favour of self.locking_column= | Jon Leighton | 2011-11-29 | 1 | -1/+1 |
| | |||||
* | Deprecate set_primary_key in favour of self.primary_key= | Jon Leighton | 2011-11-29 | 12 | -14/+14 |
| | |||||
* | Deprecate set_sequence_name in favour of self.sequence_name= | Jon Leighton | 2011-11-29 | 1 | -1/+1 |
| | |||||
* | Deprecate set_inheritance_column in favour of self.inheritance_column= | Jon Leighton | 2011-11-29 | 1 | -1/+2 |
| | |||||
* | Deprecate set_table_name in favour of self.table_name= or defining your own ↵ | Jon Leighton | 2011-11-29 | 3 | -5/+5 |
| | | | | method. | ||||
* | don't change class definition in test case | Josh Susser | 2011-11-29 | 1 | -0/+4 |
| | |||||
* | use GeneratedFeatureMethods module for associations | Josh Susser | 2011-11-27 | 1 | -1/+0 |
| | |||||
* | Allow the :class_name option for associations to take a symbol. | Jon Leighton | 2011-11-04 | 1 | -0/+1 |
| | | | | | This is to avoid confusing newbies, and to be consistent with the fact that other options like :foreign_key already allow a symbol or a string. | ||||
* | Tests gotta run in 1.8 too | Jeremy Kemper | 2011-10-13 | 1 | -2/+2 |
| | |||||
* | Added ActiveRecord::Base.store for declaring simple single-column key/value ↵ | David Heinemeier Hansson | 2011-10-13 | 1 | -0/+1 |
| | | | | stores [DHH] | ||||
* | Raise error when using write_attribute with a non-existent attribute. | Jon Leighton | 2011-09-13 | 1 | -6/+7 |
| | | | | | | | | | Previously we would just silently write the attribute. This can lead to subtle bugs (for example, see the change in AutosaveAssociation where a through association would wrongly gain an attribute. Also, ensuring that we never gain any new attributes after initialization will allow me to reduce our dependence on method_missing. | ||||
* | Make protected method public so we avoid method_missing. | Jon Leighton | 2011-09-13 | 1 | -4/+5 |
| | |||||
* | Ensure we are not comparing a string with a symbol in ↵ | Jon Leighton | 2011-09-06 | 1 | -1/+1 |
| | | | | HasManyAssociation#inverse_updates_counter_cache?. Fixes #2755, where a counter cache could be decremented twice as far as it was supposed to be. | ||||
* | We need to recorder here. Need to drop the order from default scope. | Arun Agrawal | 2011-09-05 | 1 | -0/+10 |
| | | | Fixes #2832 | ||||
* | The join_nodes must be passed to the JoinDependency initializer and ↵ | Jon Leighton | 2011-08-29 | 1 | -0/+2 |
| | | | | therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556. | ||||
* | Fix default scope thread safety. Thanks @thedarkone for reporting. | Jon Leighton | 2011-08-13 | 1 | -0/+9 |
| | |||||
* | use existing model for testing Base.create with #after_initialize | Gabriel Horner | 2011-07-24 | 2 | -9/+5 |
| | |||||
* | simplify and be more explicit about create and after_initialize tests | Gabriel Horner | 2011-07-24 | 1 | -6/+2 |
| | |||||
* | fix after_initialize edge case (close #2074 and close #2175) | Les Fletcher | 2011-07-24 | 1 | -0/+13 |
| | | | | fix behavior when after_initialize is defined and a block is passed to Base.create | ||||
* | Fix exception if old and new targets are both nil. Fixes #1471. | Jon Leighton | 2011-07-12 | 1 | -1/+4 |
| | |||||
* | Assign the association attributes to the associated record before the ↵ | Jon Leighton | 2011-06-30 | 1 | -2/+7 |
| | | | | before_initialize callback of the record runs. Fixes #1842. | ||||
* | Apply the default scope earlier when doing calculations. Fixes #1682. | Jon Leighton | 2011-06-23 | 1 | -0/+6 |
| | |||||
* | Pass mass-assignment options to nested models - closes #1673. | Andrew White | 2011-06-13 | 1 | -2/+6 |
| | |||||
* | Refactor tests to be less brittle | Jon Leighton | 2011-06-12 | 1 | -0/+12 |
| | |||||
* | Test added for namedscope target. | Arun Agrawal | 2011-06-03 | 2 | -1/+6 |
| | |||||
* | Failing test for aggregating on default_scope with select | Erik Fonselius | 2011-05-31 | 1 | -0/+5 |
| | |||||
* | Tests for issue #1360 | Farley Knight | 2011-05-31 | 1 | -0/+15 |
| | |||||
* | Fix infinite recursion where a lazy default scope references a scope. Fixes ↵ | Jon Leighton | 2011-05-25 | 1 | -0/+15 |
| | | | | #1264. | ||||
* | Merge pull request #1254 from pixeltrix/ignore-includes-in-through-scope | Jon Leighton | 2011-05-24 | 2 | -0/+9 |
|\ | | | | | Ignore :includes on through associations | ||||
| * | Ignore :includes on through associations | Andrew White | 2011-05-24 | 2 | -0/+9 |
| | | |||||
* | | Failing tests for #1233. | Andrew White | 2011-05-24 | 1 | -0/+35 |
|/ | |||||
* | Refactoring test_has_many_with_pluralize_table_names_false test | Guillermo Iguaran | 2011-05-20 | 1 | -0/+1 |
| | |||||
* | Pass the attribute and option hashes to build_association | Andrew White | 2011-05-17 | 1 | -0/+13 |
| | | | | | | | The build_association method was added as an API for plugins to hook into in 1398db0. This commit restores this API and the ability to override class.new to return a subclass based on a virtual attribute in the attributes hash. | ||||
* | Merge pull request #560 from guilleiguaran/fix_pluralize_table_names_false | Jon Leighton | 2011-05-16 | 1 | -0/+3 |
|\ | | | | | Fixing has_many when ActiveRecord::Base.pluralize_table_names is false | ||||
| * | Fixing has_many association when ActiveRecord::Base.pluralize_table_names is ↵ | Guillermo Iguaran | 2011-05-15 | 1 | -0/+3 |
| | | | | | | | | false. fixes #557 | ||||
* | | CollectionAssociation#merge_target_lists should write to the underlying ↵ | Jon Leighton | 2011-05-14 | 1 | -0/+4 |
|/ | | | | attributes when copying, rather than using the assignment method | ||||
* | Don't use mass-assignment protection when setting foreign keys or ↵ | Jon Leighton | 2011-05-12 | 1 | -0/+3 |
| | | | | association conditions on singular associations. Fixes #481 (again). | ||||
* | Don't use select() values from the join model of a through association. ↵ | Jon Leighton | 2011-05-11 | 2 | -0/+8 |
| | | | | Fixes #508. | ||||
* | Add test to specify that attributes from an association's conditions should ↵ | Jon Leighton | 2011-05-10 | 2 | -0/+4 |
| | | | | be assigned without mass-assignment protection when a record is built on the association. | ||||
* | Don't quote ID's as Arel will quote them -- follow same conventions as the ↵ | Christopher Meiklejohn | 2011-05-08 | 1 | -0/+3 |
| | | | | delete method. | ||||
* | Merge pull request #357 from joshk/assign_attributes. | David Heinemeier Hansson | 2011-05-01 | 1 | -6/+17 |
|\ | | | | | Assign protected attributes with create/new and control the role. | ||||
| * | singular and collection relations in AR can now specify mass-assignment ↵ | Josh Kalderimis | 2011-05-01 | 1 | -6/+17 |
| | | | | | | | | security options (:as and :without_protection) in build, create and create! methods. | ||||
* | | removed the default_scope deprecations and updated the docs and tests to ↵ | Josh Kalderimis | 2011-04-28 | 1 | -6/+18 |
|/ | | | | reflect its use cases | ||||
* | Added assign_attributes to Active Record which accepts a mass-assignment ↵ | Josh Kalderimis | 2011-04-24 | 2 | -24/+19 |
| | | | | security scope using the :as option, while also allowing mass-assignment security to be bypassed using :with_protected |