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
Joseph Wilk
eb30e4ca40
Fixed a bug where create_table could not be called without a block [ #2221 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2009-06-21 19:51:32 +01:00
Brian Hogan
b26c2c11ab
Ensure table names are quoted while renaming for sqlite3 adapter [ #2272 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2009-06-21 18:24:19 +01:00
mattbauer
83c1934003
Ensure hm:t#create respects source associations hash conditions [ #2090 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2009-06-21 17:35:04 +01:00
Joshua Peek
d5d59230f4
Simplify AMo validation attribute reader
2009-06-17 21:27:54 -05:00
Yehuda Katz + Carl Lerche
7ac9f29093
Updated require for AMo move
2009-06-17 13:05:14 -07:00
Joshua Peek
1c4d28ba31
Move model naming into ActiveModel
2009-06-17 10:37:39 -05:00
Xavier Noria
d32965399c
uses Object#metaclass and Object#class_eval in a few spots
...
[#2797 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2009-06-12 16:14:06 -07:00
Adam Milligan
54a5446641
HasOneThroughAssociation still shouldn't derive from HasManyThroughAssociation.
...
[#1642 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2009-06-12 13:52:51 -07:00
Emilio Tagua
8db190acba
HasOneAssociation inherits AssociationProxy since it shares nothing with BelongsToAssociation.
...
[#2796 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2009-06-12 13:45:25 -07:00
Joshua Peek
8f7c657f4b
Move observing notify helper into AMo
2009-06-11 13:41:48 -05:00
Joshua Peek
4d70359200
Integrate ActiveModel::Observing into ActiveRecord
2009-06-10 23:36:44 -05:00
Michael Koziarski
c014c3e5c1
Whitelist the methods which are called by multiparameter attribute assignment.
...
This prevents users from causing NoMethodErrors and the like by editing the parameter names, and closes a potential exploit of CVE-2009-1904.
2009-06-10 12:12:21 +12:00
Eugene Pimenov
74c1249d07
PostgreSQL adapter should call thread safe quote_string function
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2009-06-09 20:12:01 +12:00
Jeremy Kemper
6e73cf6bdf
Fix AR json encoding
2009-06-08 19:37:51 -07:00
Jeremy Kemper
d9f16fafec
Update for Active Model yielding per error not per attribute
2009-06-08 19:37:50 -07:00
Giles Alexander
532219fd09
Schema dumper now records scale 0 decimal columns as decimal not integer.
...
The schema dumper would dump out any decimal or numeric column that had a zero
scale as an integer column. This will cause problems for very large precision
columns on some DBMSs, particularly PostgreSQL. It also looks strange to see
your column change type after moving through schema.rb.
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#2741 state:committed]
2009-06-01 13:40:05 +12:00
Joshua Peek
669fd84910
AS::Concern redefines "include" to lazy include modules as dependencies
2009-05-29 17:03:23 -05:00
Joshua Peek
c7c35be8fe
AS::Concern includes InstanceMethods module if it exists
2009-05-29 16:28:54 -05:00
Joshua Peek
69742ca8fa
Merge branch 'master' into active_model
...
Conflicts:
activemodel/lib/active_model/core.rb
activemodel/test/cases/state_machine/event_test.rb
activemodel/test/cases/state_machine/state_transition_test.rb
activerecord/lib/active_record/validations.rb
activerecord/test/cases/validations/i18n_validation_test.rb
activeresource/lib/active_resource.rb
activeresource/test/abstract_unit.rb
2009-05-29 16:06:21 -05:00
Joshua Peek
4e50a35fa2
Break up DependencyModule's dual function of providing a "depend_on" DSL and "included" block DSL into separate modules. But, unify both approaches under AS::Concern.
2009-05-28 11:35:36 -05:00
Jeremy Kemper
5f222c524e
Remove 'core' fluff. Hookable ActiveSupport.load_all!
2009-05-20 18:12:44 -07:00
Jeremy Kemper
ee5520a0a5
Merge branch 'master' of git@github.com:rails/rails
2009-05-18 15:02:15 -07:00
Emilio Tagua
5463823df3
Remove unnecessary condition and local variable [ #2602 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2009-05-18 22:46:37 +02:00
Jeremy Kemper
3e2f0800e3
Merge branch 'master' of git@github.com:rails/rails
2009-05-18 13:43:44 -07:00
Ken Collins
87adecfef5
Reimplement Fixtures.identify so that it consistently generates identities across ruby versions.
...
[#2633 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2009-05-18 13:40:45 -07:00
Luca Guidi
cef76c8af4
Ensure HasManyThroughAssociation#destroy delete orphan records [ #2251 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2009-05-18 22:30:43 +02:00
Jeremy Kemper
a69b28a8b1
Missing 1.8.7 backport extensions
2009-05-18 13:20:04 -07:00
Pratik Naik
c5e109bbe7
Make sure default_scope#create checks for options[:conditions] [ #2181 state:resolved] [James Le Cuirot]
2009-05-18 21:27:42 +02:00
Jeremy Kemper
37453e11e9
Revert "Get AR CI passing again by requiring the entire core_ext"
...
This reverts commit 8e6a18d867 .
2009-05-18 11:55:06 -07:00
Benjamin Floering
27de7f150b
Fixed limited eager loading associations with numbers in the name [ #2668 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2009-05-18 13:56:17 +02:00
Joshua Peek
01d7acd11d
Fix reset_session with ActiveRecord store [ #2200 state:resolved]
2009-05-17 14:42:36 -05:00
Chris Kampmeier
4e8c36a741
Implement #many? for NamedScope and AssociationCollection using #size [ #1500 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2009-05-17 18:56:06 +02:00
Daniel Guettler
25724eede9
has_one :through should not create a new association when assigned nil [ #698 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2009-05-17 14:48:20 +02:00
Yehuda Katz
8e6a18d867
Get AR CI passing again by requiring the entire core_ext
...
Note that this includes Time and Date; we should
really figure out what parts of core_ext are really
required for AR and require just those.
2009-05-16 12:09:25 -07:00
Yehuda Katz + Carl Lerche
b6bac73b28
Merge commit 'origin/master'
...
Conflicts:
actionpack/lib/action_controller/abstract/base.rb
actionpack/lib/action_controller/routing.rb
2009-05-14 17:38:30 -07:00
Peter Marklund
afcbdfc15f
Changed ActiveRecord::Base#exists? to invoke find_initial so that it is compatible with, and doesn't lose, :include scopes (references to eager loaded tables)
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#2543 state:committed]
2009-05-14 20:42:00 +12:00
Jeremy Kemper
e8550ee032
Cherry-pick core extensions
2009-05-13 12:00:15 -07:00
Jeremy Kemper
a7ccc7c79f
Remove support for deprecated validation message interpolation format
2009-05-13 11:43:03 -07:00
Bryan Helmkamp
a2875bec9a
Use DependencyModule for included hooks in ActiveRecord
2009-05-11 22:23:47 -04:00
Jeremy Kemper
ddbeb15a5e
Revert "Fixed bug with polymorphic has_one :as pointing to an STI record"
...
[#2594 state:open]
This reverts commit 99c103be11 .
2009-05-11 12:20:54 -07:00
Mike Breen
9010ed2755
Allow you to pass :all_blank to :reject_if option to automatically create a Proc that will reject any record with blank attributes.
2009-05-10 15:02:00 +12:00
Anthony Crumley
026b78f907
Fixed eager load error on find with include => [:table_name] and hash conditions like {:table_name => {:column => 'value'}}
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2009-05-10 13:36:51 +12:00
Frederick Cheung
235775de29
honour :inverse_of for joins based include
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2009-05-10 12:50:03 +12:00
Frederick Cheung
ef6f22ab2a
honour inverse_of when preloading associations
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2009-05-10 12:50:02 +12:00
Murray Steele
ccea98389a
Providing support for :inverse_of as an option to associations.
...
You can now add an :inverse_of option to has_one, has_many and belongs_to associations. This is best described with an example:
class Man < ActiveRecord::Base
has_one :face, :inverse_of => :man
end
class Face < ActiveRecord::Base
belongs_to :man, :inverse_of => :face
end
m = Man.first
f = m.face
Without :inverse_of m and f.man would be different instances of the same object (f.man being pulled from the database again). With these new :inverse_of options m and f.man are the same in memory instance.
Currently :inverse_of supports has_one and has_many (but not the :through variants) associations. It also supplies inverse support for belongs_to associations where the inverse is a has_one and it's not a polymorphic.
Signed-off-by: Murray Steele <muz@h-lame.com >
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2009-05-04 15:27:39 -07:00
Chris Kampmeier
d3ee8756c8
Don't use #tap before Active Support is available, since older versions of ruby don't have native implementations
...
[#2603 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2009-05-04 08:32:25 -07:00
Jeremy Kemper
945bf9c254
Check for sibling Active Support first
2009-05-02 15:16:12 -07:00
Ruy Asan
99c103be11
Fixed bug with polymorphic has_one :as pointing to an STI record
...
[#2594 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net >
2009-05-01 14:47:56 -07:00