Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | No need to call to_sym here | Godfrey Chan | 2014-09-20 | 1 | -1/+1 |
| | | | | | The hash is now string-keyed, and [_]reflect_on_association calls `to_s` on the argument anyway. | ||||
* | Redefine macro checks for reflections | eileencodes | 2014-07-30 | 1 | -1/+1 |
| | | | | | | | | | | | | | | Now that we define the macro on the reflection type we no longer need to check `macro == :what` on each type for `belongs_to?` or `has_one?` etc. These now default to false unless it's defined in the reflection class. Reuse existing belongs_to? method to check macros We don't need to do `:belongs_to == macro` anymore becasue we have a `belongs_to?` method. I didn't find this being used anywhere for `has_one?` or `collection?` since they were already fixed. | ||||
* | Add `:all` argument to `count` in `reset_counters` | Cade Truitt | 2014-07-02 | 1 | -1/+1 |
| | | | | | | | | | | Prior to this fix, if an association had a scope with a `select`, calls to `reset_counters` would generate invalid SQL and throw: ActiveRecord::StatementInvalid: [$DB_ADAPTER]: wrong number of arguments to function COUNT() References #10710, #13648 | ||||
* | Refactoring .reflections public method. | Arthur Neves | 2014-05-26 | 1 | -1/+1 |
| | | | | | | Now the internal reflections will hold a reference to its public representation, so when the outside world calls `Account.reflection` we can build a list of public reflections. | ||||
* | Merge pull request #15210 from arthurnn/fix_hbtm_reflection | Arthur Neves | 2014-05-24 | 1 | -3/+2 |
| | | | | | | | | | Fix habtm reflection Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/counter_cache.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/reflection_test.rb | ||||
* | Updates reset_counters to allow counter name in params | Jason Normore | 2014-05-16 | 1 | -5/+10 |
| | | | | | | | Add support for counter name to be passed as parameter on `CounterCache::ClassMethods#reset_counters`. This is to be consistent with the other methods in the module that all accept counter name. | ||||
* | Restore the destroy_by_association check in post destroy counter cache | Jean Boussier | 2014-04-15 | 1 | -2/+9 |
| | |||||
* | Set _after_create_counter_called flag to make update counter cache work | Jean Boussier | 2014-04-15 | 1 | -1/+6 |
| | |||||
* | Use inheritance chain instead of callbacks to increment counter caches after ↵ | Jean Boussier | 2014-04-14 | 1 | -4/+4 |
| | | | | destroy | ||||
* | Use inheritance chain instead of callbacks to increment counter caches after ↵ | Jean Boussier | 2014-04-14 | 1 | -0/+16 |
| | | | | create | ||||
* | Make counter cache decrementation on destroy idempotent | Jean Boussier | 2014-04-13 | 1 | -0/+21 |
| | |||||
* | Spelling and Grammar checks | Akshay Vishnoi | 2013-12-12 | 1 | -4/+4 |
| | |||||
* | changed update counter to act on unscoped model | heruku | 2013-11-26 | 1 | -1/+1 |
| | |||||
* | pass the pk to compile_update | Aaron Patterson | 2013-11-16 | 1 | -1/+1 |
| | |||||
* | update_counters accepts a hash, not an array of hashes | Michael Kozono | 2013-05-21 | 1 | -1/+1 |
| | |||||
* | `#reset_counters` verifies counter names. | Yves Senn | 2013-03-15 | 1 | -1/+2 |
| | | | | | | | Closes #9724. Raise an `ArgumentError` when the name of the counter does not match an association name. | ||||
* | grammar improvements for increment_counter and decrement_counter docs | Matthew Robertson | 2012-12-02 | 1 | -6/+8 |
| | |||||
* | increment_counter and decrement_counter can accept and array of ids as an arg | Matthew Robertson | 2012-12-02 | 1 | -2/+2 |
| | |||||
* | 1.9 Syntax related changes | AvnerCohen | 2012-11-10 | 1 | -2/+2 |
| | |||||
* | Refactor | Santiago Pastorino | 2012-10-03 | 1 | -5/+4 |
| | |||||
* | Fix reset_counters() crashing on has_many :through associations. | lulalala | 2012-10-02 | 1 | -2/+7 |
| | | | | | The counter column name in the intermediate model need to be access via the through reflection. | ||||
* | reset_counters() was crashing when there were multiple belongs_to ↵ | Dave Desrochers | 2012-08-21 | 1 | -1/+1 |
| | | | | | | associations with the same foreign key. This closes #5200. | ||||
* | Simplify AR configuration code. | Jon Leighton | 2012-06-15 | 1 | -98/+102 |
| | | | | | Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc. | ||||
* | remove deprecate #update_all usage | Jon Leighton | 2012-04-26 | 1 | -1/+1 |
| | |||||
* | Remove IdentityMap | Carlos Antonio da Silva | 2012-03-13 | 1 | -2/+0 |
| | |||||
* | Refactor and cleanup in some ActiveRecord modules | Carlos Antonio da Silva | 2012-03-03 | 1 | -1/+1 |
| | | | | | | | | | | | * Avoid double hash lookups in AR::Reflection when reflecting associations/aggregations * Minor cleanups: use elsif, do..end, if..else instead of unless..else * Simplify DynamicMatchers#respond_to? * Use "where" instead of scoped with conditions hash * Extract `scoped_by` method pattern regexp to constant * Extract noisy class_eval from method_missing in dynamic matchers * Extract readonly check, avoid calling column#to_s twice in persistence * Refactor predicate builder, remove some variables | ||||
* | Remove not used if..else clause | Carlos Antonio da Silva | 2012-01-23 | 1 | -6/+0 |
| | | | | Related to #4614. | ||||
* | Unused var removed | Arun Agrawal | 2012-01-23 | 1 | -1/+1 |
| | |||||
* | Fix bug where reset_counters resets the wrong counter cache. | David Peter | 2012-01-16 | 1 | -1/+2 |
| | | | | | | | | If a model belongs_to two associations with the same class, then reset_counters will reset the wrong counter cache. Finding the right reflection should use the foreign_key instead, which should be unique. | ||||
* | Remove unnecessary comma. | Uģis Ozols | 2011-12-26 | 1 | -1/+1 |
| | |||||
* | Make it the responsibility of the connection to hold onto an ARel visitor ↵ | Jon Leighton | 2011-08-08 | 1 | -1/+1 |
| | | | | for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now. | ||||
* | Remove extra white spaces on ActiveRecord docs. | Sebastian Martinez | 2011-05-23 | 1 | -1/+1 |
| | |||||
* | Merge remote branch 'rails/master' into identity_map | Emilio Tagua | 2010-12-20 | 1 | -1/+2 |
|\ | | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/persistence.rb | ||||
| * | removing more calls to deprecated methods | Aaron Patterson | 2010-12-02 | 1 | -1/+2 |
| | | |||||
* | | Added method to IM to remove objects by class and id. Then used it to remove ↵ | Emilio Tagua | 2010-11-19 | 1 | -0/+2 |
|/ | | | | objects when updating counters. | ||||
* | Use COALESCE in update_counters docs to reflect the implementation | Carlos Antonio da Silva | 2010-08-18 | 1 | -3/+3 |
| | |||||
* | Refactor previous commits a bit. | José Valim | 2010-07-08 | 1 | -7/+10 |
| | |||||
* | reset_counter should work with non-traditional belongs_to and polymorphic ↵ | Neeraj Singh | 2010-07-08 | 1 | -3/+9 |
| | | | | | | | | belongs_to [#4984 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com> | ||||
* | Adds title and basic description where needed. | Rizwan Reza | 2010-06-15 | 1 | -0/+1 |
| | |||||
* | fix `reset_counters` to work even with complex class names | Mislav Marohnić | 2010-05-24 | 1 | -4/+6 |
| | | | | | | e.g. it guesses that a belongs_to association to Namespace::MyModel is named "my_model", unlike before where it would look up an association named "namespace::mymodel" and fail. | ||||
* | cleanup `update/reset_counters`: less SQL strings, more ActiveRecord/Arel | Mislav Marohnić | 2010-05-24 | 1 | -12/+8 |
| | |||||
* | eliminate alias_method_chain from ActiveRecord | wycats | 2010-05-09 | 1 | -0/+107 |