mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-15 01:11:23 +00:00
4199062a9c
Added model annotations
23 lines
432 B
Ruby
23 lines
432 B
Ruby
# == Schema Information
|
|
#
|
|
# Table name: locks
|
|
#
|
|
# id :integer not null, primary key
|
|
# lockable_id :integer
|
|
# lockable_type :string(255)
|
|
# created_at :datetime
|
|
# updated_at :datetime
|
|
#
|
|
|
|
class Lock < ActiveRecord::Base
|
|
include Extra
|
|
belongs_to :lockable, :polymorphic => true
|
|
|
|
def can_create? cuser
|
|
cuser and cuser.admin?
|
|
end
|
|
|
|
def can_destroy? cuser
|
|
cuser and cuser.admin?
|
|
end
|
|
end
|