Class: Noah::Token

Inherits:
Model
  • Object
show all
Includes:
Linkable, Taggable
Defined in:
lib/noah/models/tokens.rb

Instance Method Summary collapse

Methods included from Linkable

included, #link!, #unlink!

Methods included from Taggable

included, #tag!, #untag!

Methods inherited from Model

inherited

Instance Method Details

#to_hashObject



22
23
24
25
# File 'lib/noah/models/tokens.rb', line 22

def to_hash
  h = {:token => token, :lifetime => lifetime, :created_at => created_at, :updated_at => updated_at}
  super.merge(h)
end

#validateObject



15
16
17
18
19
20
# File 'lib/noah/models/tokens.rb', line 15

def validate
  super
  assert_present :name
  assert_unique :name
  assert_unique :token
end