rails_look_up_table 0.5.0 → 0.6.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.
Files changed (2) hide show
  1. data/lib/rails_look_up_table.rb +1 -1
  2. metadata +2 -2
@@ -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
- where(foreign_key.to_sym => record.id )
38
+ includes(table.to_s.pluralize.to_sym).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.5.0
4
+ version: 0.6.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: -4125104331717472094
168
+ hash: -2403267945975502180
169
169
  required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  none: false
171
171
  requirements: