diff options
author | José Valim <jose.valim@gmail.com> | 2009-07-13 15:08:45 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-07-13 15:08:45 +0200 |
commit | ae7a7852d56bd99304affa220dd4d91a2fff16a7 (patch) | |
tree | 776f5523669f4d6d55a3155473f0007ebc3ec7e2 | |
parent | d5225c1fd50a672d57ee30d3b107c2596318b02f (diff) | |
download | rails-ae7a7852d56bd99304affa220dd4d91a2fff16a7.tar.gz rails-ae7a7852d56bd99304affa220dd4d91a2fff16a7.tar.bz2 rails-ae7a7852d56bd99304affa220dd4d91a2fff16a7.zip |
Always allow params to be skipped on action orm in generators.
-rw-r--r-- | railties/lib/generators/action_orm.rb | 2 | ||||
-rw-r--r-- | railties/lib/generators/active_record.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/generators/action_orm.rb b/railties/lib/generators/action_orm.rb index 3b0fee7206..69cf227fd7 100644 --- a/railties/lib/generators/action_orm.rb +++ b/railties/lib/generators/action_orm.rb @@ -39,7 +39,7 @@ module Rails # GET edit # PUT update # DELETE destroy - def self.find(klass, params) + def self.find(klass, params=nil) raise NotImplementedError end diff --git a/railties/lib/generators/active_record.rb b/railties/lib/generators/active_record.rb index 6640988c40..64bee3904e 100644 --- a/railties/lib/generators/active_record.rb +++ b/railties/lib/generators/active_record.rb @@ -25,7 +25,7 @@ module ActiveRecord "#{klass}.all" end - def self.find(klass, params) + def self.find(klass, params=nil) "#{klass}.find(#{params})" end @@ -41,7 +41,7 @@ module ActiveRecord "#{name}.save" end - def update_attributes(params) + def update_attributes(params=nil) "#{name}.update_attributes(#{params})" end |