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 |
|
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 |
|
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 |
|
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 |
|
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)
|
data/lib/resourceful/version.rb
CHANGED