Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | 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. | ||||
* | Don't require a DB connection when setting primary key. | Jon Leighton | 2011-09-26 | 1 | -0/+4 |
| | | | | Closes #2807. | ||||
* | Rename first_or_new to first_or_initialize. | Jon Leighton | 2011-09-13 | 1 | -1/+1 |
| | | | | | For consistency with find_or_initialize_by. Also remove first_or_build alias. | ||||
* | Always generate attribute methods on the base class. | Jon Leighton | 2011-09-13 | 1 | -1/+1 |
| | | | | | | | | | | | | | | This fixes a situation I encountered where a subclass would cache the name of a generated attribute method in @_defined_class_methods. Then, when the superclass has it's attribute methods undefined, the subclass would always have to dispatch through method_missing, because the presence of the attribute in @_defined_class_methods would mean that it is never generated again, even if undefine_attribute_methods is called on the subclass. There various other confusing edge cases like this. STI classes share columns, so let's just keep all the attribute method generation state isolated to the base class. | ||||
* | Adding first_or_create, first_or_create!, first_or_new and first_or_build to ↵ | Andrés Mejía | 2011-08-30 | 1 | -0/+1 |
| | | | | | | | | | | Active Record. This let's you write things like: User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson", :hot => true) Related to #2420. | ||||
* | Move clear_timestamp_attributes into Timestamp module | Jon Leighton | 2011-08-29 | 1 | -9/+1 |
| | |||||
* | do not compute table names for abstract classes | Akira Matsuda | 2011-08-24 | 1 | -0/+2 |
| | |||||
* | In 1efd88283ef68d912df215125951a87526768a51, ConnectionAdapters was put ↵ | Jon Leighton | 2011-08-16 | 1 | -1/+2 |
| | | | | under eager_autoload. Due to the requires in that file, this caused ConnectionSpecification to be loaded, which references ActiveRecord::Base, which means the database connection is established. We do not want to connect to the database when Active Record is loaded, only when ActiveRecord::Base is first referenced by the user. | ||||
* | Merge branch 'master' of github.com:lifo/docrails | Xavier Noria | 2011-08-13 | 1 | -0/+4 |
|\ | | | | | | | | | | | | | | | | | | | | | Conflicts: RELEASING_RAILS.rdoc actionpack/lib/sprockets/railtie.rb actionpack/test/template/sprockets_helper_test.rb activerecord/test/cases/calculations_test.rb railties/guides/source/3_1_release_notes.textile railties/guides/source/active_resource_basics.textile railties/guides/source/command_line.textile | ||||
| * | Document exclamation point on dynamic finders | Florent Guilleux | 2011-08-13 | 1 | -0/+4 |
| | | |||||
| * | Revert "Explicitly included hashes in sentence regarding SQL-injection-safe ↵ | Xavier Noria | 2011-08-13 | 1 | -3/+3 |
| | | | | | | | | | | | | | | | | forms" Reason: The hash form is secure, and preferred over the array form if possible. This reverts commit 6dc749596c328c44c80f898d5fa860fff6cab783. | ||||
| * | Explicitly included hashes in sentence regarding SQL-injection-safe forms | Pete Campbell | 2011-07-28 | 1 | -3/+3 |
| | | |||||
* | | Perf: don't mess around with thread local vars unless we actually need to | Jon Leighton | 2011-08-13 | 1 | -18/+23 |
| | | |||||
* | | Fix default scope thread safety. Thanks @thedarkone for reporting. | Jon Leighton | 2011-08-13 | 1 | -15/+26 |
| | | |||||
* | | Fully marshal AR::Base objects. Fixes #2431. | Jon Leighton | 2011-08-08 | 1 | -21/+0 |
| | | |||||
* | | Make it the responsibility of the connection to hold onto an ARel visitor ↵ | Jon Leighton | 2011-08-08 | 1 | -2/+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. | ||||
* | | Revert "Explicitly included hashes in sentence regarding SQL-injection-safe ↵ | Xavier Noria | 2011-08-04 | 1 | -3/+3 |
| | | | | | | | | | | | | | | | | forms" Reason: The hash form is secure, and preferred over the array form if possible. This reverts commit 6dc749596c328c44c80f898d5fa860fff6cab783. | ||||
* | | Explicitly included hashes in sentence regarding SQL-injection-safe forms | Pete Campbell | 2011-08-04 | 1 | -3/+3 |
|/ | |||||
* | fix after_initialize edge case (close #2074 and close #2175) | Les Fletcher | 2011-07-24 | 1 | -2/+1 |
| | | | | fix behavior when after_initialize is defined and a block is passed to Base.create | ||||
* | Merge pull request #2185 from castlerock/lazy_load_abstract_adapter | Aaron Patterson | 2011-07-23 | 1 | -2/+0 |
|\ | | | | | lazy load ConnectionAdapters remove require. | ||||
| * | lazy load ConnectionAdapters remove require. | Vishnu Atrai | 2011-07-22 | 1 | -2/+0 |
| | | |||||
* | | Merge pull request #2086 from amatsuda/date_multiparameter_nil | Xavier Noria | 2011-07-23 | 1 | -3/+6 |
|\ \ | | | | | | | convert multiple Date parameters into a nil if any of its bits were blank | ||||
| * | | convert multiple Date parameters into a nil if any of its bits were blank | Akira Matsuda | 2011-07-15 | 1 | -3/+6 |
| | | | |||||
* | | | Merge branch 'master' of git://github.com/lifo/docrails | Xavier Noria | 2011-07-23 | 1 | -1/+1 |
|\ \ \ | |_|/ |/| | | |||||
| * | | use simpler words in docs | Vijay Dev | 2011-07-10 | 1 | -1/+1 |
| | | | |||||
* | | | Refactor the code a bit to reduce the duplication | Prem Sichanugrist | 2011-07-17 | 1 | -17/+8 |
| | | | |||||
* | | | Raise an ArgumentError if user passing less number of argument in the ↵ | Prem Sichanugrist | 2011-07-17 | 1 | -0/+10 |
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | dynamic finder The previous behavior was unintentional, and some people was relying on it. Now the dynamic finder will always expecting the number of arguments to be equal or greater (so you can still pass the options to it.) So if you were doing this and expecting the second argument to be nil: User.find_by_username_and_group("sikachu") You'll now get `ArgumentError: wrong number of arguments (1 for 2).` You'll then have to do this: User.find_by_username_and_group("sikachu", nil) | ||||
* | | Fix and unit test for https://github.com/rails/rails/issues/2059 | Evan Light | 2011-07-14 | 1 | -1/+2 |
|/ | | | | | | | | | | | | Cache key was incorrectly using timezone-dependent record#updated_at when it should be using a timezone-independent value to generate the cache key Minor refactoring to cache_key timezone test Closes #2059 Adds a test to validate the format of the cache_key for nil and present updated_at values Correctly handles updated_at == nil | ||||
* | Merge pull request #1273 from jeremyf/feature-association-proxy-send | Santiago Pastorino | 2011-07-06 | 1 | -1/+1 |
|\ | | | | | Addresses an inconsistency in the ActiveRecord::Base.method_missing handl | ||||
| * | Addresses an inconsistency in the ActiveRecord::Base.method_missing handling ↵ | Jeremy Friesen | 2011-05-24 | 1 | -1/+1 |
| | | | | | | | | of dynamic finder methods and the passing of the &block parameter for :find_by_attributes. | ||||
* | | Use an instance variable to store the current masss assignment options | Andrew White | 2011-07-04 | 1 | -9/+14 |
| | | |||||
* | | call super rather than delegating to the other objects equal? method | Aaron Patterson | 2011-06-30 | 1 | -1/+1 |
| | | |||||
* | | just alias eql? to == for frewer method calls | Aaron Patterson | 2011-06-30 | 1 | -5/+1 |
| | | |||||
* | | Define to_ary on ActiveRecord::Base to return nil. Improve performance of ↵ | Jon Leighton | 2011-06-30 | 1 | -0/+12 |
| | | | | | | | | Array#flatten under 1.9, see comment for details. | ||||
* | | Merge pull request #1860 from dmathieu/comparison | Aaron Patterson | 2011-06-28 | 1 | -0/+9 |
|\ \ | | | | | | | Allow comparison on model objects - Closes #1858 | ||||
| * | | comparing different classes returns nil | Damien Mathieu | 2011-06-26 | 1 | -1/+5 |
| | | | |||||
| * | | allow comparison on model objects - Closes #1858 | Damien Mathieu | 2011-06-26 | 1 | -0/+5 |
| | | | |||||
* | | | remove useless assignment | Aaron Patterson | 2011-06-28 | 1 | -2/+1 |
| | | | |||||
* | | | reduce object allocation during AR instantiation | Aaron Patterson | 2011-06-28 | 1 | -0/+2 |
| | | | |||||
* | | | remove the check for needs_type_condition? because ensure_proper_type will ↵ | Aaron Patterson | 2011-06-27 | 1 | -2/+3 |
| | | | | | | | | | | | | pick up the type column | ||||
* | | | stop using && for the short circuit side effect | Aaron Patterson | 2011-06-27 | 1 | -1/+1 |
| | | | |||||
* | | | let strings be converted to symbols inside the interpreter | Aaron Patterson | 2011-06-27 | 1 | -2/+2 |
| | | | |||||
* | | | avoice paying hash cost if there are no serialized attributes | Aaron Patterson | 2011-06-27 | 1 | -3/+4 |
| | | | |||||
* | | | cache column defaults for AR object instantiation | Aaron Patterson | 2011-06-27 | 1 | -0/+6 |
| | | | |||||
* | | | AR object instantiation is ~30% faster in the simple case | Aaron Patterson | 2011-06-27 | 1 | -1/+1 |
| | | | |||||
* | | | initialize instance variables | Aaron Patterson | 2011-06-27 | 1 | -0/+2 |
|/ / | |||||
* | | Perf fix - Use an instance variable instead of a class_attribute. Thanks ↵ | Jon Leighton | 2011-06-16 | 1 | -8/+4 |
| | | | | | | | | @josevalim and @jhawthorn for the prompting. | ||||
* | | Pass mass-assignment options to nested models - closes #1673. | Andrew White | 2011-06-13 | 1 | -3/+6 |
| | | |||||
* | | don't reinitialize the arel_table unless the table_name changes | Damien Mathieu | 2011-06-09 | 1 | -1/+2 |
| | |