Class: EnvironmentClass

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/environment_class.rb

Class Method Summary collapse

Class Method Details

.is_in_any_environment(puppetclass, lookup_key) ⇒ Object

TODO move these into scopes?


18
19
20
# File 'app/models/environment_class.rb', line 18

def self.is_in_any_environment(puppetclass, lookup_key)
  EnvironmentClass.where(:puppetclass_id => puppetclass, :lookup_key_id => lookup_key ).count > 0
end

.key_in_environment(env, puppetclass, lookup_key) ⇒ Object


22
23
24
# File 'app/models/environment_class.rb', line 22

def self.key_in_environment(env, puppetclass,  lookup_key)
  EnvironmentClass.where(:environment_id => env, :puppetclass_id => puppetclass, :lookup_key_id => lookup_key ).first
end