Commit Graph

3328 Commits

Author SHA1 Message Date
José Valim
7cc0a4cfa1 Use activerecord.errors.format as in Rails 2.3.5. 2010-01-02 22:27:02 +01:00
José Valim
5fdd0e80a4 Be sure to convert namespaced names to we have 'Parrots name' instead of 'Parrots.name' in error messages. 2010-01-02 22:27:02 +01:00
José Valim
dcafe995bf Make nested attributes behave like in 2.3.5 and add a sanity test for it with I18n. 2010-01-02 22:27:02 +01:00
Pratik Naik
ac1df91e5e Implement Relation#create and Relation#create! 2010-01-03 00:16:14 +05:30
Pratik Naik
65200d2933 Implement Relation#new 2010-01-03 00:08:59 +05:30
Pratik Naik
32b48bf419 Use arel predicates instead of strings wherever possible when merging relations 2010-01-02 22:43:40 +05:30
Pratik Naik
f1acf1cc74 Give higher preference to second relation's equality predicates when merging 2010-01-02 21:16:16 +05:30
Pratik Naik
3e6e3e90ef Remove the test which was testing a non-existing method, always failing on 1.9 and never even running on 1.8 2010-01-02 16:12:01 +05:30
Pratik Naik
7ff131f740 Make sure not to spalt string arguments 2010-01-02 13:43:50 +05:30
Pratik Naik
4a7a14b0e1 Use relations to build uniqueness conditions 2010-01-02 03:46:08 +05:30
Pratik Naik
498fddc714 Fix join string for the WHERE clause 2010-01-02 03:20:52 +05:30
Pratik Naik
b35873a575 Rename Model.arel_table to Model.active_relation 2010-01-02 00:25:29 +05:30
Pratik Naik
d2c4b3b672 Rename Model.engine to active_relation_engine. Cache arel_table and the method takes no arguments now 2010-01-02 00:03:20 +05:30
Pratik Naik
5971842d2d Use Arel::Table instead of ActiveRecord::Relation from HABTM and has_many#delete_records 2010-01-01 23:42:13 +05:30
Pratik Naik
fc94c03c1d Remove unncessary arguments passed to arel_table 2010-01-01 23:34:15 +05:30
Pratik Naik
d200d08004 Use arel for building the STI type condition 2010-01-01 23:15:48 +05:30
Jeremy Kemper
9790f0eda5 Merge commit 'josevalim/inheritance' 2009-12-31 18:24:45 -08:00
José Valim
8c5fe60ec8 Simplify repair_validations on AR and make it work with new callbacks. 2010-01-01 03:20:38 +01:00
Pratik Naik
58ad656769 Make sure association proxy does not pass quoted table name to sanitize_sql 2010-01-01 04:37:19 +05:30
Pratik Naik
8a32d37967 Handle Range with excluded end 2010-01-01 04:33:56 +05:30
Pratik Naik
c62e88a5ab Try using cached attribute before creating a new one 2010-01-01 04:17:56 +05:30
Pratik Naik
77c23b2104 Use PredicateBuilder for sql hash sanitization 2010-01-01 04:17:56 +05:30
Pratik Naik
141d3aff2f Fix the method name for recusion 2010-01-01 04:17:56 +05:30
Pratik Naik
3c23b71a09 Move predicate building to a stand alone PredicateBuilder class 2010-01-01 04:17:55 +05:30
Carl Lerche
ae7ada1fde Some railties cleanup:
* Rename <framework>/rails.rb -> <framework>/railtie.rb
	* Rails::Plugin -> Rails::Railtie
	* Rails::Plugin::Vendored -> Rails::Plugin
2009-12-31 13:12:52 -08:00
Carl Lerche
e749424dfa Rename rails.rb -> rails/all.rb and rails/core.rb -> rails.rb 2009-12-31 13:12:52 -08:00
Pratik Naik
fdc62cdcdb Use Arel::Attribute when building where conditions from hash 2010-01-01 02:22:03 +05:30
Carl Lerche
a23f4b6aee Add a /rails.rb for each framework for consistency 2009-12-31 11:57:59 -08:00
Pratik Naik
783caae52f Use Arel::Attribute for pk conditions 2010-01-01 01:00:18 +05:30
Pratik Naik
93555c672e Add Relation#table to get the relevant Arel::Table 2010-01-01 00:56:49 +05:30
Pratik Naik
d5f9173926 Add Relation#delete [Pratik Naik, Emilio Tagua] 2010-01-01 00:17:40 +05:30
Jeremy Kemper
1fbd02e446 Revert "Add config.action_controller.include behavior to plugins."
This reverts commit 7e8b7f46bf.

Conflicts:

	railties/lib/rails/plugin.rb
2009-12-30 19:34:15 -08:00
Jeremy Kemper
10a2638db0 Fix up AR extension by using Railties module instead of Rails and requiring ControllerRuntime at initialization time instead of boot 2009-12-30 19:24:00 -08:00
Jeremy Kemper
1a0c372b19 depends on Module#attr_internal 2009-12-30 14:31:02 -08:00
Jeremy Kemper
3a29aa3abc Merge commit 'josevalim/arlog' 2009-12-30 14:01:05 -08:00
Jeremy Kemper
17787fbfdb Merge commit 'josevalim/callbacks' 2009-12-30 13:48:20 -08:00
Pratik Naik
7aabaac0f5 Organize Relation methods into separate modules 2009-12-30 19:29:26 +05:30
José Valim
4ecdf24bde Kick AR logging back to life and move ControllerRuntime inside ActiveRecord::Rails. 2009-12-30 13:07:48 +01:00
José Valim
97a64b6b22 Get rid of DeprecatedCallbacks in ActiveRecord::Associations and finally remove it. 2009-12-30 11:43:34 +01:00
Pratik Naik
8734f9a271 Relation#many? shoud load the records if there's a LIMIT 2009-12-30 12:14:00 +05:30
Pratik Naik
bdf59a5618 Add Relation#any? and Relation#many? 2009-12-30 12:11:22 +05:30
Pratik Naik
a56518aee2 Fix the count test for postgres 2009-12-30 10:41:47 +05:30
Pratik Naik
f17bb1fbff Simplify get_projection_name_from_chained_relations using recursion 2009-12-30 01:16:24 +05:30
Emilio Tagua
00cd3789f6 Relation#count should look for projections in chained relations and perform the count on the given column
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-12-30 01:12:38 +05:30
Pratik Naik
0dea509817 Oops, add the missing #tap call 2009-12-29 15:54:40 +05:30
Pratik Naik
3b8853eda4 Replace Base#safe_to_array with Array.wrap 2009-12-29 15:53:06 +05:30
Pratik Naik
0a1ff1a14f Rewrite Relation#readonly, eager_load, preload using Object#tap 2009-12-29 15:28:40 +05:30
Pratik Naik
1785e1b26e Rename Relation#create_new_relation to spawn and refactor preload/eagerload associations using attr_writer 2009-12-29 15:24:30 +05:30
Pratik Naik
61fa111a55 Refactor Relation#readonly using attr_writer 2009-12-29 15:24:30 +05:30
Pratik Naik
981f696398 Relation#respond_to? should take second argument for responding to private methods 2009-12-29 12:31:08 +05:30