Created
February 10, 2009 22:18
-
-
Save quirkey/61629 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/lib/fixjour/definitions.rb b/lib/fixjour/definitions.rb | |
| index 9bebbc4..ee9bf8d 100644 | |
| --- a/lib/fixjour/definitions.rb | |
| +++ b/lib/fixjour/definitions.rb | |
| @@ -19,13 +19,11 @@ module Fixjour | |
| # Defines the valid_*_attributes method | |
| def define_valid_attributes(name) | |
| define_method("valid_#{name}_attributes") do |*args| | |
| - valid_attributes = send("new_#{name}").attributes | |
| + valid_attributes = send("new_#{name}", *args).attributes | |
| valid_attributes.delete_if { |key, value| value.nil? } | |
| - overrides = args.extract_options! | |
| - attrs = valid_attributes.merge(overrides) | |
| - attrs.stringify_keys! | |
| - attrs.make_indifferent! | |
| - attrs | |
| + valid_attributes.stringify_keys! | |
| + valid_attributes.make_indifferent! | |
| + valid_attributes | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment