Commit Graph

2954 Commits

Author SHA1 Message Date
Carl Lerche
bd53ebde72 Add required dependencies on activemodel 2009-09-01 12:26:00 -07:00
José Valim
da636809da Assert primary key does not exist in habtm when the association is defined, instead of doing that everytime a record is inserted.
[#3128 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-01 10:15:23 -07:00
Yehuda Katz
67f5d611f5 Add rake gemspec and gemspecs to the repo 2009-08-31 17:20:44 -07:00
Josh Sharpe
80989437dc I added this feature so that a Map of changed fields could be retrieved
after a model had been saved. This is useful in the after_save callback
when you need to know what fields changed. At present there is no way
to do this other than have code in the before_save callback that takes
a copy of the changes Map, which I thought was a bit messy.

Example.

  person = Person.find_by_name('bob')
  person.name = 'robert'
  person.changes # => {'name' => ['bob, 'robert']}
  person.save
  person.changes # => {}
  person.previous_changes # => {'name' => ['bob, 'robert']}
  person.reload
  person.previous_changes # => {}

Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-31 12:50:27 -05:00
Jeffrey Hardy
c10396b142 When running multiple test tasks, don't abort early if one produces failures
[#3107 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-27 11:20:51 -07:00
Jeffrey Hardy
8c05ca96f8 Don't use AR::Base.connection for fixture column quoting. Use the connection given to Fixtures.new
[#3104 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 14:53:09 -07:00
Sven Fuchs
d672a14ee7 allow ActiveRecord#RecordInvalid exception message to be localized
[#2754 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 11:29:16 -07:00
Jeremy Kemper
c3a0a36fc3 Fix typo 2009-08-25 13:41:48 -07:00
Emilio Tagua
09fde6440a timestamps gives a created_at field not created_on.
[#3093 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-24 16:17:08 -07:00
Jeremy Kemper
8bc3a14727 Benchmark script via miloops' arel fork via DataMapper's AR comparison script 2009-08-20 21:09:59 -07:00
Pratik Naik
25e5b0c4a8 Remove support for SQLite 2.
If you're still using it, please install the plugin from git://github.com/rails/sqlite2_adapter.git
2009-08-17 14:54:34 +01:00
Jay Pignata
7213da37ce Fix test_has_many_through_polymorphic_has_one on sqlite2 [#3054 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-15 19:14:32 -07:00
Jay Pignata
cb3e669b0d Fix calculation tests on sqlite2 [#3053 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-15 19:14:11 -07:00
Jeremy Kemper
76335c27b6 Bump pg gem requirement to 0.8.0. Build psql db with UTF8 encoding. 2009-08-15 19:04:25 -07:00
Joshua Peek
c6bc8e6626 Break up concerns for choosing what attributes should be serialized and the actual serializer 2009-08-13 22:27:36 -05:00
Pratik Naik
0a558b36eb Add tests for hm:t#push failures 2009-08-11 02:37:04 +01:00
Pratik Naik
d0f891ae02 Rewrite hm:t#create tests using assert_no_difference and assert_difference 2009-08-10 21:30:44 +01:00
Pratik Naik
ad28e0037b Remove unnecessary scoping for creating hm:t join record 2009-08-10 21:20:01 +01:00
Pratik Naik
50b83984f1 Remove unnecessary scoping and validation checks from hm:t#create 2009-08-10 21:06:49 +01:00
Pratik Naik
d9c4087a9e Unify hm:t#create and create! implementation 2009-08-10 21:02:06 +01:00
Joshua Peek
f97dae5ebe Extract common dirty tracking methods in AMo 2009-08-10 13:51:48 -05:00
Joshua Peek
391f978acd AMo overrides alias_attribute and manages aliasing all known attribute method matchers 2009-08-10 11:58:44 -05:00
Arthur Zapparoli
55b5cf586a Fixed typo in test name and CHANGELOG [#3017 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-10 16:13:18 +01:00
Cristi Balan
3e35ba2481 Add tests for scoping schema_migrations index by global table prefix and suffix
[#1543 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:59:04 -07:00
Tim Peters
7eaed4fefe Use table prefix and suffix for schema_migrations index.
[#1543 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:56:37 -07:00
Jeff Dean
22f3398253 Introduce validates_with to encapsulate attribute validations in a class.
[#2630 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:47:56 -07:00
Leonardo Borges
0c391b46fb PostgreSQL: XML datatype support
[#1874 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:24:54 -07:00
Jaime Bellmyer
9c1bac0b7f raises an exception on habtm join table inserts if join table contains a primary key. Caches this check to save time on subsequent inserts.
[#2086 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:19:18 -07:00
Jaime Bellmyer
f0602214e0 raises exception (ActiveRecord::ConfigurationError with message) on habtm association creation if join table contains a primary key
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:17:39 -07:00
Morgan Schweers
d2d464e26e Fix that creating a table whose primary key prefix type is :table_name generates an incorrectly pluralized primary key.
[#872 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 21:57:56 -07:00
Jeremy Kemper
47f7c936a2 Fix test dependency on taggings 2009-08-09 21:30:55 -07:00
Gabe da Silveira
7e3364ac46 Fix that counter_cache breaks with has_many :dependent => :nullify.
[#1196 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 21:18:16 -07:00
Jatinder Singh
5704ecffad AR should respect default values for MySQL BINARY and VARBINARY columns.
[#1273 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 21:05:26 -07:00
railsbob
e06a0b03c8 has_many :through create should not raise validation errors
[#2934 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 18:44:45 -07:00
Tristan Dunn
a0f69722be Allow ho:through#build when the owner is a new record [#1749 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-10 00:46:16 +01:00
Tristan Dunn
0472839d68 Prevent overwriting of table name in merging SQL conditions [#2949 state:resolved] 2009-08-10 00:41:36 +01:00
Gabe da Silveira
00d6c76660 Enable has_many :through for going through a has_one association on the join model [#2719 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-10 00:30:44 +01:00
Arthur Zapparoli
810b59a2a9 Removed duplicated tests [#3026 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-10 00:08:40 +01:00
Arthur Zapparoli
ce2422ceaf Model#human_attribute_name now accept symbols [#3025 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2009-08-09 23:55:54 +01:00
Vladimir Meremyanin
08ec22054f Make sure association conditions work with :include and :joins [#358 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 23:10:23 +01:00
Tristan Dunn
1af9bd58a0 No longer require database name for MySQL to allow cross database selects.
[#1122 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 14:35:57 -07:00
Joshua Nichols
0ec64bea92 Added back support for destroying an association's object by id. [#2306 status:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2009-08-09 21:46:52 +01:00
Hugo Peixoto
870750ed4b With multiparameter date attributes, the behaviour when empty fields are present is now coherent with the one described in the date_select documentation.
[#1715 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 13:39:47 -07:00
Elise Huard
c5896bfd84 validate uniqueness with limit in utf8
[#2653 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 12:50:04 -07:00
Jeremy Kemper
db42f1bf67 Fix standalone test missing developer fixture 2009-08-09 11:58:07 -07:00
Hugo Peixoto
ff60ec469f Added a uniqueness validation test that uses diacritics.
[#2883 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 11:51:58 -07:00
Matt Conway
1c9b3aabdd Allow connect_timeout, read_timeout and write_timeout settings for MySQL [#2544 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 17:13:22 +01:00
railsbob
076ca48bd6 Ensure hm:t#find does not assign nil to :include [#1845 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 17:02:19 +01:00
Mike Breen
7d254b5d74 Serialized attributes should only be saved with partial_updates when the serialized attribute is present [#2397 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 16:34:53 +01:00
Dmitry Ratnikov
314ba0433f Changed to use klass instead of constantizing in assign_ids generated method
[#260 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 02:52:06 -07:00