Commit Graph

4836 Commits

Author SHA1 Message Date
Andrew White
09daaaa1e0 Add support for passing mass assignment roles to dynamic finders. Closes #1170. 2011-05-21 16:33:54 +01:00
Jon Leighton
d62a39a22b Merge pull request #1162 from guilleiguaran/singularize_individual_table_name
Singularize individual table name
2011-05-21 01:30:00 -07:00
Guillermo Iguaran
e0e8918003 AliasTracker.pluralize use pluralize_table_names of model 2011-05-20 22:54:55 -05:00
Xavier Noria
499825e19f Merge pull request #1157 from smartinez87/extra_whitespaces
Remove extra white spaces.
2011-05-20 06:03:12 -07:00
Guillermo Iguaran
6a3b3fba5a Allow pluralize_table_names for individual model 2011-05-20 01:44:13 -05:00
Guillermo Iguaran
159213001a for => each in model migration template 2011-05-20 00:22:17 -05:00
Guillermo Iguaran
e7d600dcdb Syntax cleanup: for in => each 2011-05-19 22:55:37 -05:00
Sebastian Martinez
b91c9076a6 Remove extra white spaces. 2011-05-19 20:51:33 -03:00
Jon Leighton
0afd5850f5 Implement proxy_owner, proxy_target and proxy_reflection methods on CollectionProxy with deprecations. Fixes #1148. 2011-05-19 23:28:44 +01:00
Michael Koziarski
2c08a74855 Merge pull request #1097 from kirillrdy/master
Improved "treat  0000-00-00 00:00:00 as nil Date"
2011-05-19 09:13:54 -07:00
Xavier Noria
b13d24e5b9 Merge branch 'master' of git://github.com/lifo/docrails 2011-05-18 22:50:44 +02:00
Akira Matsuda
0cd38a4af1 on.upcase! 2011-05-19 01:29:34 +09:00
Akira Matsuda
486a890505 why not use JOIN statement for joining tables? (vol. 2) 2011-05-18 18:51:03 +09:00
Akira Matsuda
df13f55d75 remove unused table from FROM clause
pg_namespace has not been used since this commit 29b0707f07
2011-05-18 18:50:33 +09:00
Akira Matsuda
a61556387a why not use JOIN statement for joining tables? 2011-05-18 18:50:33 +09:00
Santiago Pastorino
9773f6e1aa Add missing require 2011-05-17 19:50:17 -04:00
Sebastian Martinez
84e541ecb4 Better doc styling in ActiveRecord::Locking 2011-05-17 20:21:35 -03:00
Andrew White
f3b0be812e Don't pass a block as we are yielding 2011-05-17 22:33:36 +01:00
Andrew White
3773aa4fbb Add block setting of attributes to singular associations 2011-05-17 22:16:24 +01:00
Andrew White
42f1ad6865 Pass the attribute and option hashes to build_association
The build_association method was added as an API for plugins
to hook into in 1398db0. This commit restores this API and the
ability to override class.new to return a subclass based on
a virtual attribute in the attributes hash.
2011-05-17 20:43:30 +01:00
Kirill Radzikhovskyy
6f0ebe040a Year 0 should fall to nil only if month and day are also 0 2011-05-17 16:31:09 +10:00
Jon Leighton
2033ff825b Merge pull request #560 from guilleiguaran/fix_pluralize_table_names_false
Fixing has_many when ActiveRecord::Base.pluralize_table_names is false
2011-05-16 15:40:12 -07:00
Sebastian Martinez
2470392e89 Add doc to #attribute_names 2011-05-15 21:33:49 -03:00
Prem Sichanugrist
5ca67eca21 Add ActiveRecord::attribute_names to retrieve a list of attribute names. This method will also return an empty array on an abstract class or a model that the table doesn't exists. 2011-05-15 19:07:40 -04:00
Guillermo Iguaran
ecbde46e57 Fixing has_many association when ActiveRecord::Base.pluralize_table_names is false. fixes #557 2011-05-15 03:53:10 -05:00
Jon Leighton
7e6145b4a2 These extra array operations appear to be unnecessary. Reasoning:
* It is not necessary to subtract 'id' from the list of copied attributes because record and mem_record are equal, so therefore their id attributes are also equal (so there is no harm in copying it, and this reduces the complexity of the code)
 * It is not necessary to intersect the attribute names, since record and mem_record are equal, so they have the same id and class, so they have the same columns in the database. If record has non-column attributes then it seems reasonable to also copy them onto mem_record (though I am not sure what situation this would ever happen in)
2011-05-14 19:49:22 +01:00
Jon Leighton
60b23ea1da CollectionAssociation#merge_target_lists should write to the underlying attributes when copying, rather than using the assignment method 2011-05-14 19:49:22 +01:00
Jon Leighton
6660beef36 An attempt to make CollectionAssociation#merge_target_lists make more sense. 2011-05-14 19:49:22 +01:00
José Valim
e7e1d83ddf Added some docs to controller runtime. 2011-05-14 03:59:14 -07:00
Tom Ward
6d96124284 Reset ActiveRecord::LogSubscriber runtime at the start of each request
Previously the runtime was reset implicitly when #cleanup_view_runtime was called at the end of most requests. However, this doesn't happen when the request redirects, or send_file is called.  Consequently, the ActiveRecord runtime recorded in the logs included the time taken for both the current request and the previous redirect.  Explicitly resetting at the start of each request ensures that this can't happen, no matter what occurs previously.
2011-05-14 10:39:01 +01:00
Xavier Noria
d491130236 Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	actionpack/lib/action_view/helpers/date_helper.rb
	railties/lib/rails/generators/rails/app/templates/config/initializers/wrap_parameters.rb.tt
2011-05-14 11:21:27 +02:00
Jon Leighton
8a1de9b252 Instead of doing find(:all) which does scoped.find(:all) which does scoped.all, just do scoped.all. 2011-05-13 23:53:02 +01:00
Jon Leighton
5d4799d593 Remove pointless rescue (it doesn't happen anywhere in the tests, and I can't see a way that it would happen ever) 2011-05-13 23:53:02 +01:00
Aaron Patterson
a44f228fde backport skip to the AR base class 2011-05-13 13:06:59 -07:00
Aaron Patterson
ce1a1b47be supporting infinity and -infinity for timestamps in PG. fixes #544 2011-05-13 13:04:44 -07:00
Jon Leighton
6e466f17c3 Don't use mass-assignment protection when setting foreign keys or association conditions on singular associations. Fixes #481 (again). 2011-05-12 23:29:22 +01:00
Josh Kalderimis
a0000d0ea0 updated AR#create! to accept an options hash so the mass-assignment security role can be passed in, also updated the Changelog to mention the change to some of the AR method signatures. 2011-05-12 09:24:42 +02:00
Jon Leighton
d192d85668 Merge pull request #512 from pivotalneutron/fix_eager_load_with_calculations
Bug fixes for calculations with includes
2011-05-11 13:32:04 -07:00
Fadzril Muhamad & Joseph Palermo
1db49ced45 Bug fixes:
- If doing a count on a relation that has an :include and a :join, it does a distinct even though it should not.
- When doing a count on a relation that has an :include, it always falls back to a old style left join when performing the count.  Looks like it was broken here:
b9599502c9
2011-05-12 04:05:24 +08:00
knapo
bb498a5749 Fix assigning protected attributes by attributes= 2011-05-11 17:17:42 +02:00
Andrew White
0fde84c0f8 Don't remove the target if it has already been destroyed 2011-05-11 14:22:22 +01:00
Michael Ebens
ad991808d5 Modified CollectionAssociation to refer to the new class name. 2011-05-11 03:27:38 -07:00
Jon Leighton
1dd90f8f12 Don't use select() values from the join model of a through association. Fixes #508. 2011-05-11 08:56:01 +01:00
Jon Leighton
aa1fc1c88c Bring back obj.association_loaded? as a deprecated method. Fixes #472. 2011-05-11 08:56:01 +01:00
Corin Langosch
2bfeda3f09 fix bug in usage example of #unscoped 2011-05-11 09:19:12 +02:00
Jon Leighton
93a85ce333 Remove unnecessary '|| {}' 2011-05-10 23:35:15 +01:00
Jon Leighton
9a7dbe2c05 Don't use mass-assignment protection when applying the scoped.scope_for_create. Fixes #481. 2011-05-10 22:54:40 +01:00
Aaron Patterson
558334a899 deprecating CSV fixture support 2011-05-10 11:08:18 -07:00
Aaron Patterson
714fea81e4 deprecating read_csv_fixture_files method 2011-05-10 11:08:18 -07:00
slainer68
95b4989559 Puts ActiveRecord::SessionStore attributes in white list, fixes #483 2011-05-10 16:11:28 +02:00