Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Add documentation for find_or_create_by_{attribute}! method. | Andrew White | 2012-03-12 | 1 | -0/+3 |
| | |||||
* | Fix attribute_before_type_cast for serialized attributes. Fixes #4837. | Jon Leighton | 2012-02-07 | 1 | -0/+2 |
| | | | | | | Conflicts: activerecord/lib/active_record/core.rb | ||||
* | Fix another race condition. | Jon Leighton | 2012-01-20 | 1 | -3/+10 |
| | | | | | | | | | | From 2c667f69aa2daac5ee6c29ca9679616e2a71532a. Thanks @pwnall for the heads-up. Conflicts: activerecord/lib/active_record/core.rb | ||||
* | Make read_attribute code path accessible at the class level | Jon Leighton | 2011-12-22 | 1 | -6/+3 |
| | |||||
* | AS::Concern is not really needed for AR::Explain | Xavier Noria | 2011-12-16 | 1 | -1/+1 |
| | |||||
* | Move DefaultScope and NamedScope under Scoping | Jon Leighton | 2011-12-15 | 1 | -2/+1 |
| | |||||
* | Let AttributeMethods do its own including etc | Jon Leighton | 2011-12-15 | 1 | -17/+0 |
| | |||||
* | Split out most of the AR::Base code into separate modules :cake: | Jon Leighton | 2011-12-15 | 1 | -1578/+58 |
| | |||||
* | Make with_scope public so we stop using send :bomb: | José Valim | 2011-12-15 | 1 | -90/+91 |
| | |||||
* | Allow nested attributes in associations to update values in it's owner ↵ | Andrew Kaspick | 2011-12-14 | 1 | -1/+11 |
| | | | | object. Fixes a regression from 3.0.x | ||||
* | Cache column defaults on model. ~30% on Model.new due to avoiding repeatedly ↵ | Jon Leighton | 2011-12-14 | 1 | -2/+2 |
| | | | | fetching connection. | ||||
* | Use `table_exists?` from the schema cache. | Aaron Patterson | 2011-12-09 | 1 | -1/+1 |
| | |||||
* | Remove NilClass whiners feature. | José Valim | 2011-12-08 | 1 | -2/+0 |
| | | | | | | | | | | | | | | | | | | | | | | | | | Removing this feature causes boost in performance when using Ruby 1.9. Ruby 1.9 started to do implicit conversions using `to_ary` and `to_str` in some STDLIB methods (like Array#join). To do such implicit conversions, Ruby 1.9 always dispatches the method and rescues the NoMethodError exception in case one is raised. Therefore, since the whiners feature defined NilClass#method_missing, such implicit conversions for nil became much, much slower. In fact, just defining NilClass#method_missing (even without the whiners feature) already causes a massive slow down. Here is a snippet that shows such slow down: require "benchmark" Benchmark.realtime { 1_000.times { [nil,nil,nil].join } } class NilClass def method_missing(*args) raise NoMethodError end end Benchmark.realtime { 1_000.times { [nil,nil,nil].join } } | ||||
* | Merge pull request #3851 from ebeigarts/fix_sequence_name | Jon Leighton | 2011-12-04 | 1 | -2/+2 |
|\ | | | | | Fix sequence name with abstract classes. | ||||
| * | Fix sequence name with abstract classes. | Edgars Beigarts | 2011-12-04 | 1 | -2/+2 |
| | | |||||
* | | Merge branch 'explain' | Xavier Noria | 2011-12-04 | 1 | -0/+1 |
|\ \ | |/ |/| | |||||
| * | implements a much faster auto EXPLAIN, closes #3843 [José Valim & Xavier Noria] | Xavier Noria | 2011-12-04 | 1 | -0/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit vastly reduces the impact of auto explain logging when enabled, while keeping a negligible cost when disabled. The first implementation was based on the idea of subscribing to "sql.active_record" when needed, and unsubscribing once done. This is the idea behind AR::Relation#explain. Subscribe, collect, unsubscribe. But with the current implementation of notifications unsubscribing is costly, because it wipes an internal cache and that puts a penalty on the next event. So we are switching to an approach where a long-running subscriber is listening. Instead of collecting the queries with a closure in a dedicated subscriber, now we setup a thread local. If the feature is disabled by setting the threshold to nil, the subscriber will call a method that does nothing. That's totally cheap. | ||||
* | | Refactor readonly attributes conditional | Carlos Antonio da Silva | 2011-12-04 | 1 | -1/+2 |
|/ | |||||
* | removes the convenience instance version of AR::Base.silence_auto_explain | Xavier Noria | 2011-12-03 | 1 | -1/+1 |
| | | | | | | | Rationale: As discussed with José and Jon, this convenience shortcut is not clearly justified and it could let the user thing the disabled EXPLAINs are related to the model instance rather than being globally disabled. | ||||
* | implements AR::Base(.|#)silence_auto_explain | Xavier Noria | 2011-12-02 | 1 | -1/+1 |
| | |||||
* | implements automatic EXPLAIN logging for slow queries | Xavier Noria | 2011-12-02 | 1 | -1/+9 |
| | |||||
* | Remove the need for type_cast_attribute. | Jon Leighton | 2011-12-01 | 1 | -1/+1 |
| | | | | This is good because it reduces duplication. | ||||
* | Get rid of the underscore versions of attribute methods! | Jon Leighton | 2011-12-01 | 1 | -0/+1 |
| | | | | This makes me happy! | ||||
* | Revert "Added ActiveRecord::Base#last_modified to work with the new ↵ | David Heinemeier Hansson | 2011-12-01 | 1 | -7/+0 |
| | | | | | | | | fresh_when/stale? conditional get methods from Action Pack" Needless indirection with no added value. This reverts commit 535853e83b9092078035a5abb2aa242fba815c05. | ||||
* | Added ActiveRecord::Base#last_modified to work with the new ↵ | David Heinemeier Hansson | 2011-12-01 | 1 | -0/+7 |
| | | | | fresh_when/stale? conditional get methods from Action Pack | ||||
* | Add hackery to make Syck use encode_with/init_with. Fixes 1.8 after recent ↵ | Jon Leighton | 2011-12-01 | 1 | -0/+20 |
| | | | | changes to attribute serialization. | ||||
* | omg computer science! | Jon Leighton | 2011-11-30 | 1 | -2/+2 |
| | | | | | | | Implement a mini state machine for serialized attributes. This means we do not have to deserialize the values upon initialization, which means that if we never actually access the attribute, we never have to deserialize it. | ||||
* | Move some serialization stuff out of Base | Jon Leighton | 2011-11-30 | 1 | -40/+0 |
| | |||||
* | Extract attribute serialization code into a separate module | Jon Leighton | 2011-11-30 | 1 | -0/+1 |
| | |||||
* | ActiveRecord::Relation#pluck method | Bogdan Gusiev | 2011-11-30 | 1 | -1/+1 |
| | |||||
* | Fix ruby 1.8 compat. const_defined? only takes a second arg on 1.9. | Jon Leighton | 2011-11-29 | 1 | -3/+4 |
| | |||||
* | Deprecated `define_attr_method` in `ActiveModel::AttributeMethods` | Jon Leighton | 2011-11-29 | 1 | -2/+2 |
| | | | | | This only existed to support methods like `set_table_name` in Active Record, which are themselves being deprecated. | ||||
* | Make sure the original_foo accessor still works (but deprecated) if we are ↵ | Jon Leighton | 2011-11-29 | 1 | -6/+31 |
| | | | | using self.foo= | ||||
* | extract method | Jon Leighton | 2011-11-29 | 1 | -49/+25 |
| | |||||
* | Deprecate set_sequence_name in favour of self.sequence_name= | Jon Leighton | 2011-11-29 | 1 | -11/+28 |
| | |||||
* | Add tests for set_sequence_name etc | Jon Leighton | 2011-11-29 | 1 | -1/+1 |
| | |||||
* | Deprecate set_inheritance_column in favour of self.inheritance_column= | Jon Leighton | 2011-11-29 | 1 | -17/+29 |
| | |||||
* | Deprecate set_table_name in favour of self.table_name= or defining your own ↵ | Jon Leighton | 2011-11-29 | 1 | -22/+59 |
| | | | | method. | ||||
* | Merge pull request #3636 from joshsusser/master | Jon Leighton | 2011-11-29 | 1 | -0/+14 |
|\ | | | | | association methods are now generated in modules | ||||
| * | use GeneratedFeatureMethods module for associations | Josh Susser | 2011-11-27 | 1 | -0/+14 |
| | | |||||
* | | remove useless class_eval | Aaron Patterson | 2011-11-28 | 1 | -2/+0 |
| | | |||||
* | | pushing caching and visitors down to the connection | Aaron Patterson | 2011-11-19 | 1 | -9/+9 |
|/ | |||||
* | self.up, self.down => up, down | Akira Matsuda | 2011-11-07 | 1 | -2/+2 |
| | |||||
* | Update ActiveRecord#attribute_present? to work as documented | Justin Mazzi | 2011-11-05 | 1 | -1/+2 |
| | | | | | | | "Returns true if the specified attribute has been set by the user or by a database load and is neither nil nor empty?" Fixes #1613 | ||||
* | Add ActiveRecord::Relation#uniq for toggling DISTINCT in the SQL query | Jon Leighton | 2011-11-05 | 1 | -1/+3 |
| | |||||
* | Merge branch 'master' of github.com:lifo/docrails | Vijay Dev | 2011-10-14 | 1 | -2/+2 |
|\ | |||||
| * | change activerecord query conditions example to avoid 'type' as column name | Steve Bourne | 2011-10-12 | 1 | -2/+2 |
| | | | | | | | | | | | | | | | | 'Type' is a reserved column for STI. Changed conditions example to avoid using that column name as an example. The example isn't STI-related (and mentioning STI here is needless clutter), so changing to avoid accidentally encouraging users to use 'type' as a column name for other purposes. | ||||
* | | Added ActiveRecord::Base.store for declaring simple single-column key/value ↵ | David Heinemeier Hansson | 2011-10-13 | 1 | -1/+1 |
|/ | | | | stores [DHH] | ||||
* | Revert "Raise error on unknown primary key." | Jon Leighton | 2011-10-05 | 1 | -5/+4 |
| | | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07. | ||||
* | Raise error on unknown primary key. | Jon Leighton | 2011-10-05 | 1 | -4/+5 |
| | | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307. |