module Fogged::HasManyResources::ClassMethods

Constants

DEFAULT_OPTIONS

Public Instance Methods

has_many_resources(*args) click to toggle source
# File lib/fogged/has_many_resources.rb, line 11
def has_many_resources(*args)
  options = args.extract_options!
  unless options.include?(:through)
    fail(ArgumentError, ":through option is mandatory")
  end
  has_many :resources, DEFAULT_OPTIONS.merge(options)
  validate :_check_resources, :unless => "resources.empty?"
end