Module: Golden::Setting::Resourced::ClassMethods
- Defined in:
- app/models/concerns/golden/setting/resourced.rb
Instance Method Summary collapse
- #with_settings ⇒ Object
- #with_settings_for(name) ⇒ Object
- #without_settings ⇒ Object
- #without_settings_for(name) ⇒ Object
Instance Method Details
#with_settings ⇒ Object
9 10 11 12 |
# File 'app/models/concerns/golden/setting/resourced.rb', line 9 def with_settings select("DISTINCT #{self.table_name}.*"). joins("JOIN `#{settings_table}` ON (#{join_settings_on})") end |
#with_settings_for(name) ⇒ Object
14 15 16 17 |
# File 'app/models/concerns/golden/setting/resourced.rb', line 14 def with_settings_for name joins("JOIN `#{settings_table}` ON (#{join_settings_on})"). where("`#{settings_table}`.name = ?", name) end |
#without_settings ⇒ Object
19 20 21 22 |
# File 'app/models/concerns/golden/setting/resourced.rb', line 19 def without_settings joins("LEFT JOIN `#{settings_table}` ON (#{join_settings_on})"). where("`#{settings_table}`.id IS NULL") end |
#without_settings_for(name) ⇒ Object
24 25 26 27 |
# File 'app/models/concerns/golden/setting/resourced.rb', line 24 def without_settings_for name without_settings. where("`#{settings_table}`.name = ?", name) end |