Method: ImpressionistController::InstanceMethods#impressionist
- Defined in:
- app/controllers/impressionist_controller.rb
#impressionist(obj, message = nil, opts = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/controllers/impressionist_controller.rb', line 15 def impressionist(obj,=nil,opts={}) if should_count_impression?(opts) if obj.respond_to?("impressionable?") if unique_instance?(obj, opts[:unique]) obj.impressions.create(associative_create_statement({:message => })) end else # we could create an impression anyway. for classes, too. why not? raise "#{obj.class.to_s} is not impressionable!" end end end |