Sha256: e898582bf047636da4785a87f15a0a03d676b3bcd83bdda4ef99f362c12fe48a

Contents?: true

Size: 715 Bytes

Versions: 2

Compression:

Stored size: 715 Bytes

Contents

module ExtremeAas
  class ExtremeAction < ActiveRecord::Base
    belongs_to :actionable, :polymorphic => true, :dependent => :destroy
    has_many :grants, :class_name => 'ExtremeGrant', :dependent => :destroy
    has_many :action_edges, :class_name => 'ExtremeActionEdge', :foreign_key => 'child_action_id', :dependent => :destroy
    
    def self.parse args={}
      if args.include? :group
        return ExtremeActionGroup.find_by_name(args[:group]).super_action
      end
      return ExtremeSimpleAction.where(args).first.super_action
    end
    
    def method_missing(method, *args, &block)
      super
    rescue NoMethodError => e
      self.actionable.send(method, *args, &block)
    end
    
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
extreme_aas-0.0.2 app/models/extreme_aas/extreme_action.rb
extreme_aas-0.0.1 app/models/extreme_aas/extreme_action.rb