diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-24 21:24:29 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-03-24 21:24:29 +0000 |
commit | 2c3abbeef6298683dd199f2a5e663caaaa88dffa (patch) | |
tree | e20950ee2d67a4e4aa8d6b267814aecfe2b5570d /lib/puppet/rails/resource.rb | |
parent | 33f4a66a4ead50a570bd5eeeb97087829f84e132 (diff) | |
download | puppet-2c3abbeef6298683dd199f2a5e663caaaa88dffa.tar.gz puppet-2c3abbeef6298683dd199f2a5e663caaaa88dffa.tar.xz puppet-2c3abbeef6298683dd199f2a5e663caaaa88dffa.zip |
Refactoring some of the rails code. The speed is now pretty good, but the tagging stuff does not seem to be working and is certainly working very ineffficiently. Blake says he is going to take a look at that.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2350 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/rails/resource.rb')
-rw-r--r-- | lib/puppet/rails/resource.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/puppet/rails/resource.rb b/lib/puppet/rails/resource.rb index c3bf8c38a..4f26af6d9 100644 --- a/lib/puppet/rails/resource.rb +++ b/lib/puppet/rails/resource.rb @@ -14,19 +14,30 @@ class Puppet::Rails::Resource < ActiveRecord::Base acts_as_taggable def tags=(tags) - tags.each do |tag| - self.tag_with tag + #puts "setting tags %s" % tags.inspect + self.tag_with(tags.join(",")) + end + + def file + if f = self.source_file + return f.filename + else + return nil end end def file=(file) - self.source_file = Puppet::Rails::SourceFile.new(:filename => file) + self.source_file = Puppet::Rails::SourceFile.new(:filename => file) end def [](param) return super || parameter(param) end + def name + ref() + end + def parameter(param) if pn = param_names.find_by_name(param) if pv = pn.param_values.find(:first) |