has_options 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/has_options.gemspec +1 -1
- data/lib/has_options/has_options.rb +3 -2
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/has_options.gemspec
CHANGED
@@ -11,8 +11,9 @@ module HasOptionsHash
|
|
11
11
|
|
12
12
|
association_name = configuration[:association_name].to_s
|
13
13
|
singular_association = association_name.singularize
|
14
|
-
|
15
|
-
|
14
|
+
option_model = configuration[:option_model]
|
15
|
+
table_name = option_model.constantize.table_name
|
16
|
+
has_many association_name, :class_name => configuration[:option_model], :as => :entity, :dependent => :destroy, :conditions => {:association_type => association_name}
|
16
17
|
|
17
18
|
class_eval <<-EOV
|
18
19
|
define_method "find_#{singular_association}_value" do |name|
|