aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | | | | Rollback where.like and where.not_likeCarlos Antonio da Silva2012-12-073-46/+4
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The real win with these chain methods is where.not, that takes care of different scenarios in a graceful way, for instance when the given value is nil. where("author.id != ?", author_to_ignore.id) where.not("author.id", author_to_ignore.id) Both where.like and where.not_like compared to the SQL versions doesn't seem to give us that much: Post.where("title LIKE 'ruby on%'") Post.where.like(title: 'ruby on%'") Post.where("title NOT LIKE 'ruby on%'") Post.where.not_like(title: 'ruby on%'") Thus Rails is adding where.not, but not where.like/not_like and others.
* | | | | | | | Fix READMEDavid Heinemeier Hansson2012-12-071-1/+1
| | | | | | | |
* | | | | | | | Rename all action callbacks from *_filter to *_actionDavid Heinemeier Hansson2012-12-073-69/+118
| | | | | | | |
* | | | | | | | Merge pull request #8452 from claudiob/explain_where_chain_parametersCarlos Antonio da Silva2012-12-072-2/+23
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Document the types of arguments accepted by AR#not
| * | | | | | | | Document the types of arguments accepted by AR#notclaudiob2012-12-072-2/+23
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit stems from https://github.com/rails/rails/pull/8332#issuecomment-11127957 Since the formats in which conditions can be passed to `not` differ from the formats in which conditions can be passed to `like` and `not_like`, then I think it's worth adding rdoc and tests to show this behavior
* | | | | | | | revises a RDoc example to make it idiomaticXavier Noria2012-12-071-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The force flag suggests the original was probably copied from some db/schema.rb. Thanks to Josh Susser for spotting and reporting this.
* | | | | | | | let @version be always externally set in guides generation [fixes #8221]Xavier Noria2012-12-072-2/+2
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shelling out was there for authors convenience, but we are rather going to have the tag or SHA1 always in RAILS_VERSION and if the environment variable is blank, then just use "local" as a reminder that you are just working locally. The docs server has been updated to set the long SHA1 in RAILS_VERSION when generating edge guides.
* | | | | | | Fix where.not with in clauseCarlos Antonio da Silva2012-12-072-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Arel::Nodes::In inherits from Arel::Nodes::Equality, so the case statement was always using the Equality operator for both scenarios, resulting in a not equal query instead.
* | | | | | | Merge pull request #8445 from claudiob/match_rdoc_with_6ba0f97Carlos Antonio da Silva2012-12-071-4/+4
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Update #where rdoc to match 6ba0f97 [ci skip]
| * | | | | | | Update #where rdoc to match 6ba0f97 [ci skip]claudiob2012-12-071-4/+4
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit updates the rdoc of AR#where to match the changes applied in https://github.com/rails/rails/commit/6ba0f97 that is: * `where(nil)` has the same effect of `where('')`: a no op * `where` (no args) has the same effect of `where(:chain)`: to create a WhereChain
* | | | | | | Revert "Invert precedence of content in ActionDispatch::Static"Andrew White2012-12-074-51/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c59734f756b79c39486c45273d2cc5d42cd0c864.
* | | | | | | Move where with blank conditions test to the correct where tests fileCarlos Antonio da Silva2012-12-072-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This test does not belong to has many associations test.
* | | | | | | Ensure there won't be any regression with where(nil) callsCarlos Antonio da Silva2012-12-072-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider this scenario: if params[:foo] conditions = { foo: true } end foos = Foo.where(conditions).order(:id) When params[:foo] is nil, this would call: foos = Foo.where(nil).order(:id) In this scenario, we want Foo.where(conditions) to be the same as calling Foo.all, otherwise we'd get a "NoMethodError order for WhereChain". Related to #8332.
* | | | | | | Merge pull request #8332 from amatsuda/ar_where_chainCarlos Antonio da Silva2012-12-075-8/+200
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Relation.where with no args can be chained with not, like, and not_like Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/relation/query_methods.rb
| * | | | | | | Relation.where with no args can be chained with not, like, and not_likeAkira Matsuda2012-11-305-8/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | examples: Model.where.not field: nil #=> "SELECT * FROM models WHERE field IS NOT NULL Model.where.like name: 'Jeremy%' #=> "SELECT * FROM models WHERE name LIKE 'Jeremy%' this feature was originally suggested by Jeremy Kemper https://github.com/rails/rails/pull/5950#issuecomment-5591330 Closes #5950
* | | | | | | | Stop shelling out more than necessaryCarlos Antonio da Silva2012-12-071-10/+10
| | | | | | | |
* | | | | | | | Unscope update_column(s) query to ignore default scopeCarlos Antonio da Silva2012-12-063-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When applying default_scope to a class with a where clause, using update_column(s) could generate a query that would not properly update the record due to the where clause from the default_scope being applied to the update query. class User < ActiveRecord::Base default_scope where(active: true) end user = User.first user.active = false user.save! user.update_column(:active, true) # => false In this situation we want to skip the default_scope clause and just update the record based on the primary key. With this change: user.update_column(:active, true) # => true Fixes #8436.
* | | | | | | | Improve AR changelogCarlos Antonio da Silva2012-12-061-18/+17
| | | | | | | |
* | | | | | | | Remove method redefined warningsCarlos Antonio da Silva2012-12-061-1/+1
| | | | | | | |
* | | | | | | | Use CURRENT_TIMESTAMP since it has apparently better cross db supportCarlos Antonio da Silva2012-12-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LOCALTIMESTAMP is not support by sqlite3, and travis was giving us these errors: https://travis-ci.org/rails/rails/jobs/3535241/#L570
* | | | | | | | Run rake tasks all at once in rake dbs test for a speed upCarlos Antonio da Silva2012-12-061-12/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: Finished tests in 56.245787s, 0.2133 tests/s, 0.0000 assertions/s. 12 tests, 0 assertions, 0 failures, 0 errors, 0 skips After: Finished tests in 42.401416s, 0.2830 tests/s, 0.0000 assertions/s. 12 tests, 0 assertions, 0 failures, 0 errors, 0 skips
* | | | | | | | Merge pull request #8440 from steveklabnik/masterRafael Mendonça França2012-12-061-0/+3
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CHANGELOG for 78d5d6f [ci skip]
| * | | | | | | | CHANGELOG for 78d5d6f.Steve Klabnik2012-12-061-0/+3
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was pointed out by @giner that the CHANGELOG entry for https://github.com/rails/rails/commit/78d5d6f8688bb7c45ba9a3ef893682231130da3f wasn't included. Here it is.
* | | | | | | | Merge pull request #8439 from joshsusser/fixesCarlos Antonio da Silva2012-12-063-5/+5
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Fixes issues in test_mysql2
| * | | | | | | | Oracle needs table to check index existenceJosh Susser2012-12-061-3/+3
| | | | | | | | |
| * | | | | | | | convert time to stringJosh Susser2012-12-062-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | why is this a Time to start with?
* | | | | | | | | Change the encrypted campfire notification tokenRafael Mendonça França2012-12-061-1/+1
| | | | | | | | |
* | | | | | | | | Invert precedence of content in ActionDispatch::StaticAndrew White2012-12-064-12/+51
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit inverts the precedence in ActionDispatch::Static so that dynamic content will be served before static content. This is so that precompiled assets do not inadvertently get included when running in development mode - it should have no effect in production where static files are usually handled by the web server. Closes #6421
* | | | | | | | Refactor tests that switch RAILS_ENV and RACK_ENVCarlos Antonio da Silva2012-12-066-63/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleanup aims to fix a build failure: https://travis-ci.org/rails/rails/jobs/3515951/#L482 Since travis always have both ENV vars set to "test", a test is failing where it's expected to output the default env "development", but "test" is the result due to RACK_ENV being set when we expect it to not be. By cleaning this duplication we ensure that changing any of these env variables will pick the right expected value.
* | | | | | | | Add comment about implementation of class_attributeAndrew White2012-12-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To prevent future pull requests like #8435 add a comment about the implementation of class_attribute using class_eval for performance. [ci skip]
* | | | | | | | adds a couple of items to the check list for stable releases [ci skip]Xavier Noria2012-12-061-0/+3
| | | | | | | |
* | | | | | | | Merge pull request #8431 from joshsusser/schemadumpAaron Patterson2012-12-051-4/+2
|\ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / |/| | | | | | | dump schema.rb without :version option
| * | | | | | | dump schema.rb without :version optionJosh Susser2012-12-051-4/+2
|/ / / / / / /
* | | | | | | Merge branch 'joshsusser-master' into mergeAaron Patterson2012-12-0515-58/+268
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * joshsusser-master: style cleanup Add migration history to schema.rb dump Add metadata to schema_migrations Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/schema.rb
| * | | | | | | style cleanupJosh Susser2012-12-033-6/+5
| | | | | | | |
| * | | | | | | Add migration history to schema.rb dumpJosh Susser2012-12-029-17/+146
| | | | | | | |
| * | | | | | | Add metadata to schema_migrationsJosh Susser2012-12-0110-43/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | migrated_at: timestamp when migration run fingerprint: md5 hash of migration source name: filename without version or extension
* | | | | | | | Merge pull request #8429 from reednj77/turbolinks-js-include-orderCarlos Antonio da Silva2012-12-051-3/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Revert turbolinks load order requirement
| * | | | | | | | Revert turbolinks load order requirementNick Reed2012-12-051-3/+1
|/ / / / / / / /
* | | | | | | | Fix duplicated method nameCarlos Antonio da Silva2012-12-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | | | Merge pull request #8427 from kennyj/support_rack_envRafael Mendonça França2012-12-057-5/+67
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Add ENV['RACK_ENV'] support to rake runner/console/server.
| * | | | | | | | Add ENV['RACK_ENV'] support to rake runner/console/server.kennyj2012-12-067-5/+67
|/ / / / / / / /
* | | | | | | | Merge pull request #8424 from kennyj/tiny_fixes_20121206Xavier Noria2012-12-051-3/+7
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | fix warning: possibly useless use of a constant in void context
| * | | | | | | | silence warning: possibly useless use of a constant in void contextkennyj2012-12-061-3/+7
|/ / / / / / / /
* | | | | | | | Merge pull request #8371 from freegenie/5396-conditional-fragment-cachingRafael Mendonça França2012-12-053-1/+83
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow fragment cache to accept :if and :unless options. Closes #5396
| * | | | | | | | Allow fragment cache to accept :if and :unless optionsFabrizio Regini2012-12-053-1/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [Stephen Ausman + Fabrizio Regini]
* | | | | | | | | Merge pull request #8412 from ↵Rafael Mendonça França2012-12-051-18/+14
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | JoeyButler/action_dispatch_routing_mapper_refactoring Extract method refactoring.
| * | | | | | | | Extract method refactoring in ActionDispatch::Routing::SingletonResource.Joey Butler2012-12-051-18/+14
| | | | | | | | |
* | | | | | | | | Merge pull request #8404 from freegenie/filter_redirectsAndrew White2012-12-059-5/+96
|\ \ \ \ \ \ \ \ \
| * | | | | | | | | Adding filter capability to ActionController logsFabrizio Regini2012-12-059-5/+96
| | | | | | | | | |