diff options
Diffstat (limited to 'lib/puppet/rails')
-rw-r--r-- | lib/puppet/rails/database/schema.rb | 8 | ||||
-rw-r--r-- | lib/puppet/rails/fact_value.rb | 2 | ||||
-rw-r--r-- | lib/puppet/rails/host.rb | 7 | ||||
-rw-r--r-- | lib/puppet/rails/resource_tag.rb | 2 | ||||
-rw-r--r-- | lib/puppet/rails/source_file.rb | 2 |
5 files changed, 12 insertions, 9 deletions
diff --git a/lib/puppet/rails/database/schema.rb b/lib/puppet/rails/database/schema.rb index 20d2e967f..a2477f2e6 100644 --- a/lib/puppet/rails/database/schema.rb +++ b/lib/puppet/rails/database/schema.rb @@ -21,7 +21,7 @@ class Puppet::Rails::Schema # Thanks, mysql! MySQL requires a length on indexes in text fields. # So, we provide them for mysql and handle everything else specially. - # Oracle doesn't index on CLOB fields, so we skip it + # Oracle doesn't index on CLOB fields, so we skip it if Puppet[:dbadapter] == "mysql" execute "CREATE INDEX typentitle ON resources (restype,title(50));" elsif Puppet[:dbadapter] != "oracle_enhanced" @@ -51,10 +51,10 @@ class Puppet::Rails::Schema t.column :created_at, :datetime end - # Oracle automatically creates a primary key index - if Puppet[:dbadapter] != "oracle_enhanced" + # Oracle automatically creates a primary key index + if Puppet[:dbadapter] != "oracle_enhanced" add_index :puppet_tags, :id, :integer => true - end + end create_table :hosts do |t| t.column :name, :string, :null => false diff --git a/lib/puppet/rails/fact_value.rb b/lib/puppet/rails/fact_value.rb index e4cc6dd3c..a451cbb88 100644 --- a/lib/puppet/rails/fact_value.rb +++ b/lib/puppet/rails/fact_value.rb @@ -3,7 +3,7 @@ class Puppet::Rails::FactValue < ActiveRecord::Base belongs_to :host def to_label - "#{self.fact_name.name}" + "#{self.fact_name.name}" end end diff --git a/lib/puppet/rails/host.rb b/lib/puppet/rails/host.rb index 6b057dd2d..7a3fe75bc 100644 --- a/lib/puppet/rails/host.rb +++ b/lib/puppet/rails/host.rb @@ -83,8 +83,11 @@ class Puppet::Rails::Host < ActiveRecord::Base # Return the value of a fact. def fact(name) - if fv = self.fact_values.find(:all, :include => :fact_name, - :conditions => "fact_names.name = '#{name}'") + + if fv = self.fact_values.find( + :all, :include => :fact_name, + + :conditions => "fact_names.name = '#{name}'") return fv else return nil diff --git a/lib/puppet/rails/resource_tag.rb b/lib/puppet/rails/resource_tag.rb index 8d088fd2d..f094eabb8 100644 --- a/lib/puppet/rails/resource_tag.rb +++ b/lib/puppet/rails/resource_tag.rb @@ -3,7 +3,7 @@ class Puppet::Rails::ResourceTag < ActiveRecord::Base belongs_to :resource def to_label - "#{self.puppet_tag.name}" + "#{self.puppet_tag.name}" end # returns an array of hash containing tags of resource diff --git a/lib/puppet/rails/source_file.rb b/lib/puppet/rails/source_file.rb index de95f755a..6a691893a 100644 --- a/lib/puppet/rails/source_file.rb +++ b/lib/puppet/rails/source_file.rb @@ -3,6 +3,6 @@ class Puppet::Rails::SourceFile < ActiveRecord::Base has_one :resource def to_label - "#{self.filename}" + "#{self.filename}" end end |