Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Fix sequence name with abstract classes. | Edgars Beigarts | 2011-12-04 | 1 | -0/+10 |
| | |||||
* | Create method with known identifier then alias into place. | Jon Leighton | 2011-12-01 | 1 | -0/+2 |
| | | | | | | | | This means we never have to rely on define_method (which is slower and uses more memory), even when we have attributes containing characters that are not allowed in standard method names. (I am mainly changing this because the duplication annoys me, though.) | ||||
* | Deprecated `define_attr_method` in `ActiveModel::AttributeMethods` | Jon Leighton | 2011-11-29 | 1 | -21/+12 |
| | | | | | This only existed to support methods like `set_table_name` in Active Record, which are themselves being deprecated. | ||||
* | Deprecate set_primary_key in favour of self.primary_key= | Jon Leighton | 2011-11-29 | 1 | -2/+26 |
| | |||||
* | Make sure the original_foo accessor still works (but deprecated) if we are ↵ | Jon Leighton | 2011-11-29 | 1 | -7/+55 |
| | | | | using self.foo= | ||||
* | Deprecate set_sequence_name in favour of self.sequence_name= | Jon Leighton | 2011-11-29 | 1 | -2/+6 |
| | |||||
* | Add tests for set_sequence_name etc | Jon Leighton | 2011-11-29 | 1 | -0/+22 |
| | |||||
* | Deprecate set_inheritance_column in favour of self.inheritance_column= | Jon Leighton | 2011-11-29 | 1 | -2/+7 |
| | |||||
* | Deprecate set_table_name in favour of self.table_name= or defining your own ↵ | Jon Leighton | 2011-11-29 | 1 | -7/+20 |
| | | | | method. | ||||
* | Merge pull request #3636 from joshsusser/master | Jon Leighton | 2011-11-29 | 1 | -0/+9 |
|\ | | | | | association methods are now generated in modules | ||||
| * | use GeneratedFeatureMethods module for associations | Josh Susser | 2011-11-27 | 1 | -0/+9 |
| | | |||||
* | | `ActiveRecord::Base#becomes` should retain the errors of the original object. | James Adam | 2011-11-16 | 1 | -0/+8 |
|/ | | | | This commit contains a simple failing test that demonstrates the behaviour we expect, and a fix. When using `becomes` to transform the type of an object, it should retain any error information that was present on the original instance. | ||||
* | Add ActiveRecord::Relation#uniq for toggling DISTINCT in the SQL query | Jon Leighton | 2011-11-05 | 1 | -0/+6 |
| | |||||
* | Revert "Raise error on unknown primary key." | Jon Leighton | 2011-10-05 | 1 | -0/+4 |
| | | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07. | ||||
* | Raise error on unknown primary key. | Jon Leighton | 2011-10-05 | 1 | -4/+0 |
| | | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307. | ||||
* | Rename first_or_new to first_or_initialize. | Jon Leighton | 2011-09-13 | 1 | -10/+2 |
| | | | | | For consistency with find_or_initialize_by. Also remove first_or_build alias. | ||||
* | Add missing require in base_test.rb, fixes isolated test | Guillermo Iguaran | 2011-09-09 | 1 | -0/+1 |
| | |||||
* | Merge pull request #2757 from andmej/first_or_create_pull_request | Jon Leighton | 2011-09-08 | 1 | -0/+31 |
|\ | | | | | Add first_or_create family of methods to Active Record | ||||
| * | Adding first_or_create, first_or_create!, first_or_new and first_or_build to ↵ | Andrés Mejía | 2011-08-30 | 1 | -0/+31 |
| | | | | | | | | | | | | | | | | | | | | 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. | ||||
* | | Disable active record marshalling tests on Ruby 1.8.7 on Travis CI, as they ↵ | Jon Leighton | 2011-09-06 | 1 | -0/+15 |
| | | | | | | | | have been failing intermittently for a long while due to what appears to be a Ruby bug. If anyone has the skills/expertise/time to debug this, please speak to the Travis guys. | ||||
* | | Need to add here to pass the test | Arun Agrawal | 2011-09-03 | 1 | -0/+1 |
|/ | | | As in previous commit it's removed. | ||||
* | Merge pull request #2750 from rsim/fix_test_column_names_are_escaped_for_oracle | Jon Leighton | 2011-08-30 | 1 | -1/+7 |
| | | | | Fix test column names are escaped for oracle | ||||
* | do not compute table names for abstract classes | Akira Matsuda | 2011-08-24 | 1 | -0/+4 |
| | |||||
* | prevent sql injection attacks by escaping quotes in column names | Aaron Patterson | 2011-08-16 | 1 | -0/+17 |
| | |||||
* | Work around for lolruby bug. (Read on for explanation.) | Jon Leighton | 2011-08-13 | 1 | -3/+8 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were experiencing CI test failures, for example: * 3-1-stable: http://travis-ci.org/#!/rails/rails/builds/79473/L407 * master: http://travis-ci.org/#!/rails/rails/builds/79507/L80 These failures only happened on 1.8.7-p352, and we were only able to reproduce on the Travis CI VM worker. We even tried creating a new 32 bit Ubuntu VM and running the tests on that, and it all worked fine. After some epic trial and error, we discovered that replacing the following: fuu = Marshal.load(Marshal.dump(fuu)) with: marshalled = Marshal.dump(fuu) fuu = Marshal.load(marshalled) seemed to prevent the failure. We have NO IDEA why this is. If anyone has some great insight to contribute then that is welcome. Otherwise, hopefully this will just help us get the CI green again. Many thanks to @joshk for help with sorting this out. | ||||
* | Fully marshal AR::Base objects. Fixes #2431. | Jon Leighton | 2011-08-08 | 1 | -0/+13 |
| | |||||
* | Make it the responsibility of the connection to hold onto an ARel visitor ↵ | Jon Leighton | 2011-08-08 | 1 | -19/+0 |
| | | | | 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 deprication warning: ambiguous first argument; put parentheses or ↵ | Vishnu Atrai | 2011-07-26 | 1 | -1/+1 |
| | | | | even spaces | ||||
* | Revert "allow select to have multiple arguments" | Piotr Sarnacki | 2011-07-26 | 1 | -5/+0 |
| | | | | | | | This reverts commit 04cc446d178653d362510e79a22db5300d463161. I reverted it because apparently we want to use: select([:a, :b]) instead of select(:a, :b), but there was no tests for that form. | ||||
* | allow select to have multiple arguments | Sławosz Sławiński | 2011-07-26 | 1 | -0/+5 |
| | |||||
* | use existing model for testing Base.create with #after_initialize | Gabriel Horner | 2011-07-24 | 1 | -9/+7 |
| | |||||
* | simplify and be more explicit about create and after_initialize tests | Gabriel Horner | 2011-07-24 | 1 | -18/+10 |
| | |||||
* | fix after_initialize edge case (close #2074 and close #2175) | Les Fletcher | 2011-07-24 | 1 | -0/+23 |
| | | | | fix behavior when after_initialize is defined and a block is passed to Base.create | ||||
* | Merge pull request #2086 from amatsuda/date_multiparameter_nil | Xavier Noria | 2011-07-23 | 1 | -24/+9 |
|\ | | | | | 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 | -24/+9 |
| | | |||||
* | | bigdecimal should be typecast to a float on sqlite3. fixes #2162 | Aaron Patterson | 2011-07-20 | 1 | -0/+11 |
|/ | |||||
* | Fix and unit test for https://github.com/rails/rails/issues/2059 | Evan Light | 2011-07-14 | 1 | -2/+27 |
| | | | | | | | | | | | | 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 | ||||
* | ActiveRecord::Base should pass ActiveModel::Lint. | Grant Hutchins & Peter Jaros | 2011-07-08 | 1 | -0/+10 |
| | |||||
* | comparing different classes returns nil | Damien Mathieu | 2011-06-26 | 1 | -0/+6 |
| | |||||
* | allow comparison on model objects - Closes #1858 | Damien Mathieu | 2011-06-26 | 1 | -0/+7 |
| | |||||
* | please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT | Aaron Patterson | 2011-06-06 | 1 | -1/+1 |
| | |||||
* | Refactor Active Record test connection setup. Please see the ↵ | Jon Leighton | 2011-06-04 | 1 | -1/+1 |
| | | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases. | ||||
* | Raise NameError instead of ArgumentError in ActiveSupport::Dependencies | Andrew White | 2011-06-01 | 1 | -0/+7 |
| | | | | | | | | ActiveSupport::Dependencies now raises NameError if it finds an existing constant in load_missing_constant. This better reflects the nature of the error which is usually caused by calling constantize on a nested constant. Closes #1423 | ||||
* | removed deprecated methods, and related tests, from ActiveRecord | Josh Kalderimis | 2011-05-25 | 1 | -7/+0 |
| | |||||
* | Allow pluralize_table_names for individual model | Guillermo Iguaran | 2011-05-20 | 1 | -0/+9 |
| | |||||
* | Add ActiveRecord::attribute_names to retrieve a list of attribute names. ↵ | Prem Sichanugrist | 2011-05-15 | 1 | -0/+13 |
| | | | | This method will also return an empty array on an abstract class or a model that the table doesn't exists. | ||||
* | Fix assigning protected attributes by attributes= | knapo | 2011-05-11 | 1 | -2/+7 |
| | |||||
* | minor cleaning | Vishnu Atrai | 2011-05-10 | 1 | -1/+1 |
| | |||||
* | Multiparameter POLA, time_select fixes. See LH4346 | Aditya Sanghi | 2011-05-05 | 1 | -0/+135 |
| | |||||
* | deprecated the use of the guard_protected_attributes argument with ↵ | Josh Kalderimis | 2011-04-25 | 1 | -0/+6 |
| | | | | attributes= in AR in favor of assign_attributes(attrs, :without_protection => true) |