app/models/pbw/trigger.rb in pbw-0.0.9 vs app/models/pbw/trigger.rb in pbw-0.0.10
- old
+ new
@@ -1,9 +1,9 @@
module Pbw
class Trigger < Rule
- has_and_belongs_to_many :tokens
- has_and_belongs_to_many :areas
- belongs_to :process
+ has_and_belongs_to_many :tokens, :class_name => 'Pbw::Token'
+ has_and_belongs_to_many :areas, :class_name => 'Pbw::Area'
+ belongs_to :process, :class_name => 'Pbw::Process'
def self.viewable_by?(user, subject)
return true if user.admin?
subject.tokens.each do |token|
return true token.user && token.user == user