Module: Collectively::ActsAsCollectively::ClassMethods

Defined in:
lib/collectively/acts_as_collectively.rb

Instance Method Summary collapse

Instance Method Details

#acts_collectively(options = {}) ⇒ Object



12
13
14
15
# File 'lib/collectively/acts_as_collectively.rb', line 12

def acts_collectively(options = {})
  cattr_accessor :collectively_name
  self.collectively_name  = (options[:as] || self.name.pluralize).to_s.underscore
end

#collectively_asObject



9
10
11
# File 'lib/collectively/acts_as_collectively.rb', line 9

def collectively_as
  [self.collectively_name, :collection].join('_').camelcase
end