Class: Marley::Joints::Tags::Resources::Tag
- Defined in:
- lib/marley/joints/tags.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.list_dataset(params = {}) ⇒ Object
54 55 56 |
# File 'lib/marley/joints/tags.rb', line 54 def self.list_dataset(params={}) dataset.order(:tag) end |
Instance Method Details
#actions(parent_instance) ⇒ Object
61 62 63 |
# File 'lib/marley/joints/tags.rb', line 61 def actions(parent_instance) {:delete => "#{parent_instance ? parent_instance.url : ''}#{url}"} end |
#before_save ⇒ Object
64 65 66 67 68 |
# File 'lib/marley/joints/tags.rb', line 64 def before_save super self.tag.downcase! self.tag.strip! end |
#validate ⇒ Object
57 58 59 60 |
# File 'lib/marley/joints/tags.rb', line 57 def validate validates_presence :tag validates_unique [:tag,:user_id] end |