nakajima-fixjour 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,8 +17,8 @@ module Fixjour
17
17
  if block_given?
18
18
  define_new(klass, &block)
19
19
  else
20
- define_new(klass) do |overrides|
21
- klass.new(options.merge(overrides))
20
+ define_new(klass) do |proxy, overrides|
21
+ proxy.new(options.merge(overrides))
22
22
  end
23
23
  end
24
24
 
@@ -19,13 +19,11 @@ module Fixjour
19
19
  # Defines the valid_*_attributes method
20
20
  def define_valid_attributes(name)
21
21
  define_method("valid_#{name}_attributes") do |*args|
22
- valid_attributes = send("new_#{name}").attributes
22
+ valid_attributes = send("new_#{name}", *args).attributes
23
23
  valid_attributes.delete_if { |key, value| value.nil? }
24
- overrides = args.extract_options!
25
- attrs = valid_attributes.merge(overrides)
26
- attrs.stringify_keys!
27
- attrs.make_indifferent!
28
- attrs
24
+ valid_attributes.stringify_keys!
25
+ valid_attributes.make_indifferent!
26
+ valid_attributes
29
27
  end
30
28
  end
31
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nakajima-fixjour
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Nakajima