kelredd-resourceful 0.7.17 → 0.7.18

Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,8 @@ module Resourceful
17
17
  class_name = config.delete(:class_name).to_s
18
18
  find_method_name = (config.delete(:method) || 'find').to_s
19
19
  force = config.delete(:force) || false
20
- define_method(name) do |reload=false|
20
+ define_method(name) do |*args|
21
+ reload = args.first || false
21
22
  klass = class_name.resourceful_constantize
22
23
  raise ArgumentError, "has_many_resourceful :class_name '#{class_name}' is not defined" if klass.nil?
23
24
  unless klass.respond_to?(find_method_name)
@@ -42,7 +43,8 @@ module Resourceful
42
43
  foreign_key = config.delete(:foreign_key) || "#{clean_name}_id"
43
44
  find_method_name = (config.delete(:method) || 'find').to_s
44
45
  force = config.delete(:force) || false
45
- define_method(name) do |reload=false|
46
+ define_method(name) do |*args|
47
+ reload = args.first || false
46
48
  klass = class_name.resourceful_constantize
47
49
  raise ArgumentError, "belongs_to_resourceful :class_name '#{class_name}' is not defined" if klass.nil?
48
50
  unless self.respond_to?(foreign_key)
@@ -17,7 +17,8 @@ module Resourceful
17
17
  class_name = config.delete(:class).to_s
18
18
  find_method_name = (config.delete(:method) || 'find').to_s
19
19
  force = config.delete(:force) || false
20
- define_method(name) do |reload=false|
20
+ define_method(name) do |*args|
21
+ reload = args.first || false
21
22
  klass = self.class.get_namespaced_klass(class_name)
22
23
  raise ArgumentError, "has_many :class '#{class_name}' is not defined in any given namespaces" if klass.nil?
23
24
  unless klass.respond_to?(find_method_name)
@@ -42,7 +43,8 @@ module Resourceful
42
43
  foreign_key = config.delete(:foreign_key) || "#{clean_name}_id"
43
44
  find_method_name = (config.delete(:method) || 'find').to_s
44
45
  force = config.delete(:force) || false
45
- define_method(name) do |reload=false|
46
+ define_method(name) do |*args|
47
+ reload = args.first || false
46
48
  klass = self.class.get_namespaced_klass(class_name)
47
49
  raise ArgumentError, "belongs_to :class '#{class_name}' is not defined in any given namespaces" if klass.nil?
48
50
  unless self.respond_to?(foreign_key)
@@ -3,7 +3,7 @@ module Resourceful
3
3
 
4
4
  MAJOR = 0
5
5
  MINOR = 7
6
- TINY = 17
6
+ TINY = 18
7
7
 
8
8
  def self.to_s # :nodoc:
9
9
  [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kelredd-resourceful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.17
4
+ version: 0.7.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kelly Redding