rails_look_up_table 0.7.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/rails_look_up_table.rb +2 -2
- metadata +2 -2
data/lib/rails_look_up_table.rb
CHANGED
@@ -21,7 +21,7 @@ module LookUp
|
|
21
21
|
end
|
22
22
|
self.class.singleton_class.instance_eval do
|
23
23
|
define_method record.name.downcase.pluralize do
|
24
|
-
|
24
|
+
where(:status_id => record.id )
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -35,7 +35,7 @@ module LookUp
|
|
35
35
|
model.all.each do |record|
|
36
36
|
# returns collection of each lookup object eg Model.todos
|
37
37
|
define_singleton_method record.name.downcase.pluralize do
|
38
|
-
|
38
|
+
where(foreign_key.to_sym => record.id )
|
39
39
|
end
|
40
40
|
# adds boolean methods to check whether an object is of lookup type eg. @instance.pending?
|
41
41
|
define_method "#{record.name.downcase}?" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_look_up_table
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -165,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
165
165
|
version: '0'
|
166
166
|
segments:
|
167
167
|
- 0
|
168
|
-
hash:
|
168
|
+
hash: 3663058446083002309
|
169
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
170
170
|
none: false
|
171
171
|
requirements:
|