Class: Ditty::Component

Inherits:
Application show all
Defined in:
lib/ditty/controllers/component.rb

Direct Known Subclasses

AuditLogs, Roles, UserLoginTraits, Users

Instance Method Summary collapse

Methods inherited from Application

#find_template, #view_folders

Instance Method Details

#read(id) ⇒ Object



18
19
20
# File 'lib/ditty/controllers/component.rb', line 18

def read(id)
  dataset.first(settings.model_class.primary_key => id)
end

#skip_verify!Object



22
23
24
# File 'lib/ditty/controllers/component.rb', line 22

def skip_verify!
  @skip_verify = true
end

#trigger(event, attribs = {}) ⇒ Object



26
27
28
29
30
# File 'lib/ditty/controllers/component.rb', line 26

def trigger(event, attribs = {})
  attribs[:target] ||= self
  send(event, attribs) if self.respond_to? event
  broadcast(event, attribs)
end