Sha256: c4e0ac3e32c4ff2e69c62c461a5a81427c602dbf778ab2b743f686710d03a334
Contents?: true
Size: 529 Bytes
Versions: 1
Compression:
Stored size: 529 Bytes
Contents
module CanTango::Api::Ability::Dsl module Relationship def self.included(base) ::CanTango.config.user.relations.each do |relationship| base.class_eval %{ def #{relationship}_of *models, &block options = models.extract_options! scope = options[:scope] || :user relation = CanTango::Api::Ability::Relation.new :#{relationship}, self, scope, *models, &block yield relation if block relation end } end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cantango-api-0.1.3 | lib/cantango/api/ability/dsl/relationship.rb |