Ernie Miller
7f6e7ba1f7
Fixed AssociationCollection#<< resulting in unexpected values in @target when :uniq => true
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-08-08 15:19:08 +02:00
Ryan Bates
1db7c9cf4a
fixing "test_any_should_not_load_results" so it doesn't depend on latest version of Mocha
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-08-08 10:33:29 +02:00
Nik Wakelin
0809747845
Added MigrationProxy to defer loading of Migration classes until they are actually required by the migrator
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#747 state:resolved]
2008-08-06 12:46:52 +02:00
Tarmo Tänav
82343859d5
Added missing fixtures for tests which fail to run independently if run after schema reset
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-08-04 11:50:15 +02:00
Tarmo Tänav
656f0e7c6c
Fix file permissions
...
Signed-off-by: Joshua Peek <josh@joshpeek.com >
2008-07-31 16:36:23 -05:00
Tarmo Tänav
896a3b9ab8
Fixed test_joins_with_namespaced_model_should_use_correct_type for postgresql
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-07-31 19:02:32 +02:00
miloops
fb5cc19707
Fix HasManyThroughAssociationsTest tests. [ #733 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-31 17:01:22 +01:00
Pratik Naik
108db00aa9
Raise UnknownAttributeError when unknown attributes are supplied via mass assignment
2008-07-31 15:56:46 +01:00
George Ogata
e8fc894f66
Make observers define #after_find in the model only if needed.
...
[#676 state:resolved]
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-07-26 16:26:08 +02:00
Jan De Poorter
93e10f9911
Ensure NamedScope#any? uses COUNT query wherever possible. [ #680 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-23 12:02:17 +01:00
Daniel Guettler
c67713a2fe
Use klass.sti_name to make sure associations take store_full_sti_class into account. [ #671 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-22 01:24:47 +01:00
Tom Ward
f205939348
Ensure checked value is a string when validating case-sensitive uniqueness [ #361 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-19 16:14:39 +01:00
Joachim Garth
a1fcbd971d
Make sure association preloading works with full STI class name [ #465 state:Resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-18 03:44:44 +01:00
Sven Fuchs
931f366ffc
merge forward to current rails/master
2008-07-16 03:41:11 +02:00
Stefan Kaes
fbef982e4b
Observers not longer add an after_find method to the observed class.
...
[#625 state:resolved]
2008-07-15 16:48:16 -07:00
miloops
459e5817a5
update_counters should update nil values.
...
This allows counter columns with default null instead of requiring default 0.
[#493 state:resolved]
2008-07-15 16:21:11 -07:00
Jonathan Viney
4f72feb84c
Move the transaction counter to the connection object rather than maintaining it on the current Thread.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
[#533 state:resolved]
2008-07-15 21:25:12 +02:00
Tiago Macedo
76df9fa068
Fix integer quoting issues in association preload. [ #602 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-14 23:34:19 +01:00
Gabe da Silveira
cd9b24286a
Add assert_sql helper method to check for specific SQL output in Active Record test suite. [ #325 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-14 23:22:39 +01:00
Tarmo Tänav
07578ac855
Fixed mysql change_column_default to not make the column always nullable.
...
Also added change_column_null to both mysql and sqlite to keep the api features closer to postgresql.
[#617 state:resolved]
2008-07-14 12:42:01 -07:00
Tarmo Tänav
8f72bc92e2
Fixed test_rename_nonexistent_column for PostgreSQL
...
Also fixed ability to run migration_test.rb alone
[#616 state:resolved]
2008-07-14 12:22:27 -07:00
David Heinemeier Hansson
3037022789
Fixed that create database statements would always include "DEFAULT NULL" (Nick Sieger) [ #334 status:committed]
2008-07-14 10:12:54 -05:00
Sebastian A. Espindola
0176e6adb3
Added db:charset support to PostgreSQL. [ #556 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-14 04:11:52 +01:00
David Dollar
e0750d6a5c
Add :accessible option to Associations for allowing mass assignments using hash. [ #474 state:resolved]
...
Allows nested Hashes (i.e. from nested forms) to hydrate the appropriate
ActiveRecord models.
class Post < ActiveRecord::Base
belongs_to :author, :accessible => true
has_many :comments, :accessible => true
end
post = Post.create({
:title => 'Accessible Attributes',
:author => { :name => 'David Dollar' },
:comments => [
{ :body => 'First Post!' },
{ :body => 'Nested Hashes are great!' }
]
})
post.comments << { :body => 'Another Comment' }
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-14 02:53:21 +01:00
Jason Dew
c6f397c5ce
Add block syntax to HasManyAssociation#build. [ #502 state:resolve]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-14 02:24:12 +01:00
Rhett Sutphin
d72c66532f
Make fixture accessors work when fixture name is not same as the table name. [ #124 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-14 02:01:52 +01:00
Daniel Guettler
84af99e78d
Ensure NamedScope#build/create/create!/new works as expected when named scope has hash conditions. [Daniel Guettler, Pratik Naik] [ #419 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-09 14:09:17 +01:00
Chris Cherry
124d1016fa
Allow Infinity (1.0/0.0) to pass validates_numericality_of. [ #354 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-09 13:15:07 +01:00
Sven Fuchs
84816ae981
align with changes in i18n
2008-07-06 21:20:02 +02:00
Brad Greenlee
afa0c7f728
Add support for :primary_key option to has_one as well as has_many so that a key other than the default primary key can be used for the association
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-07-06 20:25:10 +02:00
Andre Arko
3351d29970
Add has_many :primary_key option to allow setting the primary key on a has many association
...
Signed-off-by: Michael Koziarski <michael@koziarski.com >
2008-07-06 20:25:10 +02:00
Sven Fuchs
e1a7f83fca
use :default for human_attribute_name
2008-07-04 22:22:20 +02:00
David Lowenfels
87fbcaa622
Add :tokenizer option to validates_length_of. [ #507 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-04 01:31:39 +01:00
Sven Fuchs
8f74ba96c4
remove core extensions in favor of I18n#translate and I18n#localize
2008-07-02 19:21:07 +02:00
Pratik Naik
474d425382
Ensure AssociationCollection#size considers all unsaved record. [ #305 state:resolved] [sds]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-07-02 03:17:33 +01:00
Tim Chater
1415df8f49
Dirty: recognize when an integer changes from zero to blank. [ #433 state:resolved]
2008-06-27 21:31:06 -07:00
Pratik Naik
9a25315076
Add extra hash conditions tests for named_scope
2008-06-28 01:57:32 +01:00
Pratik Naik
cd994eff9a
Allow conditions on multiple tables to be specified using hash.
...
Examples:
User.all :joins => :items, :conditions => { :age => 10, :items => { :color => 'black' } }
Item.first :conditions => { :items => { :color => 'red' } }
Note : Hash key in :conditions is referring to the actual table name or the alias defined in query.
2008-06-28 01:27:51 +01:00
Luca Guidi
66c2508ebb
Make sure mocha is available
2008-06-27 15:00:55 +02:00
Jeremy Kemper
4498aad4ac
MySQL: treat integer with :limit => 11 as a display width, not byte size, for backward-compatibility.
2008-06-27 01:07:22 -07:00
Jan De Poorter
b2b761166d
Make sure associated has_many/habtm objects get saved even when :validate => false is used. [ #486 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com >
2008-06-27 03:02:13 +01:00
Jeremy Kemper
f6520b7dc7
Test for tinyint
2008-06-23 23:42:06 -07:00
Sven Fuchs
8461526f34
silence deprecation warning during validations test
2008-06-23 14:55:07 +02:00
Sven Fuchs
0dddba41fc
rather cosmetic improvements of test coverage
2008-06-23 14:33:29 +02:00
Tarmo Tänav
baddea95e1
Always treat integer :limit as byte length. [ #420 state:resolved]
2008-06-22 20:42:31 -07:00
Daniel Morrison
3610997ba3
Partial updates don't update lock_version if nothing changed. [ #426 state:resolved]
2008-06-22 20:33:43 -07:00
Mark Catley
0fd3e4cd2b
Fix column collision with named_scope and :joins. [ #46 state:resolved]
2008-06-22 19:21:15 -07:00
Michael Raidel
f94600bdaf
ActiveRecord::Migrator#run records version-state after migrating. [ #369 state:resolved]
2008-06-22 18:16:17 -07:00
Tarmo Tänav
1afae84ab2
Fixed that scopes defined with a string name could not be composed
2008-06-22 17:26:00 -07:00
Tarmo Tänav
509374ebe2
Named bind variables can now be used with postgresql-style typecasts
...
For example :conditions => ['stringcol::integer = :var', { :var => 10 }]
will no longer raise an exception about ':integer' having a missing value.
2008-06-22 16:16:06 -07:00