kelredd-resourceful 0.7.13 → 0.7.14
Sign up to get free protection for your applications and to get access to all the features.
@@ -15,7 +15,7 @@ module Resourceful
|
|
15
15
|
config ||= {}
|
16
16
|
raise ArgumentError, "has_many_resourceful requires a :class_name option to be specified" unless config[:class_name]
|
17
17
|
class_name = config.delete(:class_name).to_s
|
18
|
-
find_method_name = config.delete(:method)
|
18
|
+
find_method_name = (config.delete(:method) || 'find').to_s
|
19
19
|
force = config.delete(:force) || true
|
20
20
|
define_method(name) do
|
21
21
|
klass = class_name.resourceful_constantize
|
@@ -39,7 +39,7 @@ module Resourceful
|
|
39
39
|
raise ArgumentError, "belongs_to_resourceful requires a :class_name option to be specified" unless config[:class_name]
|
40
40
|
class_name = config.delete(:class_name).to_s
|
41
41
|
foreign_key = config.delete(:foreign_key) || "#{clean_name}_id"
|
42
|
-
find_method_name = config.delete(:method)
|
42
|
+
find_method_name = (config.delete(:method) || 'find').to_s
|
43
43
|
force = config.delete(:force) || true
|
44
44
|
define_method(name) do
|
45
45
|
klass = class_name.resourceful_constantize
|
@@ -15,7 +15,7 @@ module Resourceful
|
|
15
15
|
config ||= {}
|
16
16
|
raise ArgumentError, "has_many requires a :class option to be specified" unless config[:class]
|
17
17
|
class_name = config.delete(:class).to_s
|
18
|
-
find_method_name = config.delete(:method)
|
18
|
+
find_method_name = (config.delete(:method) || 'find').to_s
|
19
19
|
force = config.delete(:force) || true
|
20
20
|
define_method(name) do
|
21
21
|
klass = self.class.get_namespaced_klass(class_name)
|
@@ -39,7 +39,7 @@ module Resourceful
|
|
39
39
|
raise ArgumentError, "belongs_to requires a :class option to be specified" unless config[:class]
|
40
40
|
class_name = config.delete(:class).to_s
|
41
41
|
foreign_key = config.delete(:foreign_key) || "#{clean_name}_id"
|
42
|
-
find_method_name = config.delete(:method)
|
42
|
+
find_method_name = (config.delete(:method) || 'find').to_s
|
43
43
|
force = config.delete(:force) || true
|
44
44
|
define_method(name) do
|
45
45
|
klass = self.class.get_namespaced_klass(class_name)
|
data/lib/resourceful/version.rb
CHANGED