kelredd-resourceful 0.7.16 → 0.7.17
Sign up to get free protection for your applications and to get access to all the features.
@@ -17,7 +17,7 @@ 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
|
20
|
+
define_method(name) do |reload=false|
|
21
21
|
klass = class_name.resourceful_constantize
|
22
22
|
raise ArgumentError, "has_many_resourceful :class_name '#{class_name}' is not defined" if klass.nil?
|
23
23
|
unless klass.respond_to?(find_method_name)
|
@@ -42,7 +42,7 @@ module Resourceful
|
|
42
42
|
foreign_key = config.delete(:foreign_key) || "#{clean_name}_id"
|
43
43
|
find_method_name = (config.delete(:method) || 'find').to_s
|
44
44
|
force = config.delete(:force) || false
|
45
|
-
define_method(name
|
45
|
+
define_method(name) do |reload=false|
|
46
46
|
klass = class_name.resourceful_constantize
|
47
47
|
raise ArgumentError, "belongs_to_resourceful :class_name '#{class_name}' is not defined" if klass.nil?
|
48
48
|
unless self.respond_to?(foreign_key)
|
@@ -17,7 +17,7 @@ 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
|
20
|
+
define_method(name) do |reload=false|
|
21
21
|
klass = self.class.get_namespaced_klass(class_name)
|
22
22
|
raise ArgumentError, "has_many :class '#{class_name}' is not defined in any given namespaces" if klass.nil?
|
23
23
|
unless klass.respond_to?(find_method_name)
|
@@ -42,7 +42,7 @@ module Resourceful
|
|
42
42
|
foreign_key = config.delete(:foreign_key) || "#{clean_name}_id"
|
43
43
|
find_method_name = (config.delete(:method) || 'find').to_s
|
44
44
|
force = config.delete(:force) || false
|
45
|
-
define_method(name
|
45
|
+
define_method(name) do |reload=false|
|
46
46
|
klass = self.class.get_namespaced_klass(class_name)
|
47
47
|
raise ArgumentError, "belongs_to :class '#{class_name}' is not defined in any given namespaces" if klass.nil?
|
48
48
|
unless self.respond_to?(foreign_key)
|
data/lib/resourceful/version.rb
CHANGED