Class: Noah::Tags
- Inherits:
-
Object
- Object
- Noah::Tags
- Defined in:
- lib/noah/models/tags.rb
Class Method Summary collapse
Class Method Details
.all(options = {}) ⇒ Object
105 106 107 108 109 110 |
# File 'lib/noah/models/tags.rb', line 105 def self.all( = {}) tag_hash = Hash.new .empty? ? =Tag.all.sort : =Tag.find().sort .each {|t| tag_hash["#{t.name}"] = t.to_hash.reject {|k,v| k == :name } } tag_hash end |
.tagged(tag) ⇒ Object
113 114 115 116 |
# File 'lib/noah/models/tags.rb', line 113 def tagged(tag) t = Tag.find(:name => tag).first t.members end |