Commit Graph

3319 Commits

Author SHA1 Message Date
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
Pratik Naik
bc933d0fa1 Make sure Relation responds to dynamic finder methods 2009-12-29 12:27:40 +05:30
Pratik Naik
f290e685f0 Add Relation#size and Relation#empty? 2009-12-29 12:15:28 +05:30
Pratik Naik
13989ff8c6 Use relation#delete_all for Model.delete_all 2009-12-29 11:46:07 +05:30
Pratik Naik
54b80c7361 Add Relation#delete_all 2009-12-29 11:46:07 +05:30
Carl Lerche
49c800b6bd Move the ActiveRecord related rake tasks into the AR gem. 2009-12-28 17:53:05 -08:00
José Valim
6d390671f6 Move ActiveRecord callbacks implementation to ActiveModel and make use of it.
Signed-off-by: Yehuda Katz <wycats@Yehuda-Katz.local>
2009-12-28 16:19:23 -08:00
Pratik Naik
078ea0dfbd Oops. Remove debug information inside a test from the previous commit 2009-12-29 04:33:37 +05:30
Pratik Naik
08633bae5e Migrate all the calculation methods to Relation 2009-12-29 04:30:04 +05:30
Jeremy Kemper
949c8c0d0e Don't publicize with_scope for tests since it may shadow public misuse 2009-12-28 14:07:23 -08:00