Akira Matsuda
baaf8cf83f
More unused associations in AR test models
2013-09-10 19:50:00 +02:00
Vijay Dev
ec8ef1e105
Revert "Merge branch 'master' of github.com:rails/docrails"
...
This reverts commit 70d6e16fba
, reversing
changes made to ea4db3bc07
.
Seems to be a code merge done by mistake.
2013-08-17 21:46:39 +05:30
Akira Matsuda
4dd47fb9d5
More unused associations in AR test models
2013-07-25 18:52:31 +09:00
Neeraj Singh
8ef2463807
Removed support for deprecated delete_sql
in associations.
2013-07-03 00:10:55 +05:30
Neeraj Singh
d80334488f
Removed support for deprecated finder_sql
in associations.
2013-07-02 22:08:42 +05:30
Yves Senn
a1bb6c8b06
rename Relation#uniq
to Relation#distinct
. #uniq
still works.
...
The similarity of `Relation#uniq` to `Array#uniq` is confusing. Since our
Relation API is close to SQL terms I renamed `#uniq` to `#distinct`.
There is no deprecation. `#uniq` and `#uniq!` are aliases and will continue
to work. I also updated the documentation to promote the use of `#distinct`.
2013-03-15 14:15:47 +01:00
Akira Matsuda
f228ab5574
Goodbye there, very special rubbish!
2013-01-24 18:40:59 +09:00
Jon Leighton
4efebdedf8
Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql.
2012-08-01 19:46:31 +01:00
Jon Leighton
7f3b475608
Revert "Remove :finder_sql, :counter_sql, :insert_sql, :delete_sql."
...
This reverts commit 3803fcce26
.
Conflicts:
activerecord/CHANGELOG.md
It will be deprecated only in 4.0, and removed properly in 4.1.
2012-08-01 19:46:31 +01:00
Jon Leighton
b658cf1198
Deprecate ActiveRecord::Base.scoped.
...
It doesn't serve much purpose now that ActiveRecord::Base.all returns a
Relation.
The code is moved to active_record_deprecated_finders.
2012-07-27 17:27:47 +01:00
Jon Leighton
3803fcce26
Remove :finder_sql, :counter_sql, :insert_sql, :delete_sql.
2012-07-20 19:00:46 +01:00
Jon Leighton
e1cfa6e070
Convert association macros to the new syntax
2012-07-20 14:14:51 +01:00
Jon Leighton
0a12a5f816
Deprecate eager-evaluated scopes.
...
Don't use this:
scope :red, where(color: 'red')
default_scope where(color: 'red')
Use this:
scope :red, -> { where(color: 'red') }
default_scope { where(color: 'red') }
The former has numerous issues. It is a common newbie gotcha to do
the following:
scope :recent, where(published_at: Time.now - 2.weeks)
Or a more subtle variant:
scope :recent, -> { where(published_at: Time.now - 2.weeks) }
scope :recent_red, recent.where(color: 'red')
Eager scopes are also very complex to implement within Active
Record, and there are still bugs. For example, the following does
not do what you expect:
scope :remove_conditions, except(:where)
where(...).remove_conditions # => still has conditions
2012-03-21 22:18:18 +00:00
Jon Leighton
a7e19b30ca
Add interpolation of association conditions back in, in the form of proc { ... } rather than instance_eval-ing strings
2011-02-14 01:40:31 +00:00
Jon Leighton
3103296a61
Let AssociationCollection#find use #scoped to do its finding. Note that I am removing test_polymorphic_has_many_going_through_join_model_with_disabled_include, since this specifies different behaviour for an association than for a regular scope. It seems reasonable to expect scopes and association proxies to behave in roughly the same way rather than having subtle differences.
2011-01-03 16:24:31 -08:00
José Valim
2ea1d684d9
Refactor new callbacks and AR implementation.
...
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-08 10:26:39 -05:00
Pratik Naik
45e6f19925
Revert "Revert "Generate proper :counter_sql from :finder_sql when there is a newline character immediately following 'SELECT' [ #2118 state:resolved]""
...
This reverts commit 80f1f863cd
.
The feature doesn't work on Postgres, so don't test it on Postgres.
Also, Postgres compatibility is irrelevant to the ticket/patch in question.
2009-07-01 00:02:00 +01:00
Yehuda Katz + Carl Lerche
80f1f863cd
Revert "Generate proper :counter_sql from :finder_sql when there is a newline character immediately following 'SELECT' [ #2118 state:resolved]"
...
This reverts commit 4851ca9e13
.
The tests do not pass for postgresql.
2009-06-22 12:04:02 -07:00
Patrick Joyce
4851ca9e13
Generate proper :counter_sql from :finder_sql when there is a newline character immediately following 'SELECT' [ #2118 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-06-21 22:07:23 +01:00
Pratik Naik
6513dde490
Fix tests for sqlite3 3.6.xx
2009-04-21 13:06:26 +01:00
miloops
97403ad5fd
Add :having option to find, to use in combination with grouped finds. Also added to has_many and has_and_belongs_to_many associations.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#1028 state:committed]
2008-12-01 20:22:31 +01:00
Tarmo Tänav
52ac9d0444
Fixed ordering in test_find_in_association_with_custom_finder_sql_and_multiple_interpolations
2008-08-22 10:39:45 +03:00
Jeremy Kemper
dfa786631b
Introduce the :readonly option to all associations. Records from the association cannot be saved. Closes #11084 .
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8864 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-02-13 06:32:50 +00:00
Jeremy Kemper
43b81d01d0
move assets and models
...
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2008-01-18 07:27:03 +00:00