Aaron Patterson
b7934afe32
use new skool Ruby instead of Ruby Classic™
2010-09-27 18:55:28 -07:00
Aaron Patterson
7752b2fa62
be kind to the garbage collector: only instantiate objects when absolutely necessary
2010-09-27 18:07:35 -07:00
Aaron Patterson
526ade1ff6
adding test cases for the dynamic finder matcher match method
2010-09-27 17:59:28 -07:00
Aaron Patterson
65d74312c8
constructor should not do so much work; avoid allocating object if possible
2010-09-27 17:38:49 -07:00
Aaron Patterson
133742d185
@klass also uses DynamicFinderMatch, so no need for it on the relation
2010-09-27 16:51:12 -07:00
Aaron Patterson
b1f5e90839
no need for a case / when statement
2010-09-27 16:20:46 -07:00
Aaron Patterson
f6ef4d383e
do not need intermediate variable, avoid lasgn
2010-09-27 16:20:46 -07:00
Aaron Patterson
ff5b3f5c3a
DRY up our regular expression
2010-09-27 16:20:46 -07:00
Aaron Patterson
9e652b65c2
reduce method calls in the dynamic finder matcher
2010-09-27 16:20:46 -07:00
Aaron Patterson
f22b40a8f2
make sure we use the engine assigned to the table when quoting
2010-09-27 14:29:07 -07:00
Neeraj Singh
4966b915fe
Fix for #5579 involved the code change for both has_one and has_many relationships. The path included test only for has_one. This patch adds test for has_many relationship.
...
[#5706 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-27 23:11:26 +02:00
Neeraj Singh
7f743233c4
Fix for nested_attributes with has_many association fails when a single record is being updated.
...
[#5705 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-27 23:11:24 +02:00
José Valim
fe0251e408
Merge remote branch 'miloops/warnings'
...
Conflicts:
actionpack/lib/action_controller/metal/url_for.rb
2010-09-27 21:00:54 +02:00
Aaron Patterson
e1b51955f1
adding a test for slug behavior
2010-09-27 11:33:35 -07:00
Neeraj Singh
fbd1d306b9
Three performance improvements:
...
* for simple cases like User.last and User.order('name desc').last no need to perform Array#join operation.
* Instead of performing String#blank? do Array#empty?
* no need to create variable relation
2010-09-27 10:49:49 -07:00
Aaron Patterson
e3d6434dd9
depending on arel 2.0.0
2010-09-27 09:27:39 -07:00
Emilio Tagua
eff68d86ad
Prevent shadowing outer local variable.
2010-09-27 11:19:19 -03:00
Aaron Patterson
7918a5c966
third parameter is not used
2010-09-26 18:25:13 -07:00
Nic Benders
f8c7f4cc53
db:structure:dump should list current Rails.env adapter in errors, not always the test adapter
...
[#5710 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-26 20:45:30 -03:00
Tim Connor
d6f7b7d353
Fix remove_index issue when provided :name is a symbol
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-26 20:40:14 -03:00
Piotr Sarnacki
7acf64a81b
Add namespacing for observer generator
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-25 17:28:10 +02:00
Piotr Sarnacki
00aa13bc0e
Generators fix: properly check if module should be created when creating a namespaced model
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-25 10:46:22 +02:00
Marcelo Giorgi
72543b2e63
Delegate ActiveRecord::Base.offset to scoped methods (analogous to limit) [ #5688 state:resolved]
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-24 20:24:54 -03:00
Brian Candler
a348ffcb2d
Fix warning message when db/schema.rb doesn't exist [ #5625 state:resolved]
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-24 17:40:03 -03:00
Piotr Sarnacki
bac0826b1f
Refactor namespaced generators to use module_namespacing block helper
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-24 21:02:30 +02:00
Piotr Sarnacki
e83634081a
Generators are not aware of namespace of isolated engines and applications
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-24 21:02:24 +02:00
tnp
55b6fa9370
restore behavior of touch for models without :updated_xx [ #5439 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-24 20:42:38 +02:00
Neeraj Singh
097240f602
reject_id option should be respected while using nested_attributes
...
[#5579 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com >
2010-09-24 12:46:24 +02:00
Aaron Patterson
afdf86e8ee
Hash#to_s behaves differently between 1.8 and 1.9, so adjust accordingly
2010-09-23 08:48:10 -07:00
Aaron Patterson
a4dd0b3433
switch present in favor of empty
2010-09-22 16:14:46 -07:00
Aaron Patterson
0a515dc68d
testing poor behavior of hash serialization
2010-09-22 14:58:29 -07:00
Emilio Tagua
f6de806537
Refactor association_collection uniq method.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-22 18:08:02 -03:00
Emilio Tagua
2da809da37
No need to use inject here.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-22 18:08:02 -03:00
Emilio Tagua
ea35ccfe20
Perf: refactor method.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-22 18:08:02 -03:00
Emilio Tagua
0580f5a6ac
No need to use inject here, use map instead.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-22 18:08:02 -03:00
Emilio Tagua
4513cc142c
Goodbye inject, hello map.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-22 18:08:02 -03:00
Emilio Tagua
569be76ed6
Use map instead inject.
...
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-22 18:08:02 -03:00
Santiago Pastorino
090c9ae3a3
Missing the mysql2 gem here
2010-09-22 14:33:44 -03:00
Neeraj Singh
48a108d55b
Error message should advice to use 'mysql2' gem.
...
If I create a new app using command
rails new demo -d mysql
then Gemfile contains 'mysql2' gem by default.
However if mysql gem is missing then error message says
raise "!!! Missing the mysql gem. Add it to your Gemfile: gem 'mysql', '2.8.1'"
[#5569 state:committed]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com >
2010-09-22 14:20:56 -03:00
Aaron Patterson
0cf45c850c
avoid a proc object
2010-09-22 09:01:11 -07:00
Aaron Patterson
fe8a307088
avoid creating a range object
2010-09-22 09:01:11 -07:00
Aaron Patterson
aa85a7a7e7
drying up construct_association
2010-09-21 21:01:48 -07:00
Aaron Patterson
8186c5736b
dry up some conditionals
2010-09-21 20:44:21 -07:00
Aaron Patterson
723adecab9
fixing case / when indentation
2010-09-21 20:38:36 -07:00
Aaron Patterson
9b1a4fda6f
fix case / when indentation
2010-09-21 20:32:11 -07:00
Aaron Patterson
27be777888
avoid a hash lookup
2010-09-21 20:32:00 -07:00
Aaron Patterson
e66bf6f5e3
remove more codes
2010-09-21 19:56:53 -07:00
Aaron Patterson
9b81ae6969
deleting more code
2010-09-21 19:41:15 -07:00
Aaron Patterson
8d6a6b250e
use each properly to avoid splatting a variable
2010-09-21 19:37:07 -07:00
Aaron Patterson
19ff42d909
deleting repeated codes
2010-09-21 19:27:23 -07:00