Monday, 19 August 2013

How to make your own properties, eg. "devise :authenticable" in ruby / rails

How to make your own properties, eg. "devise :authenticable" in ruby / rails

I was wondering how I could have various properties in my models. Eg:
Property < ActiveRecord::Base
locatable, saleable ...
Would these be mixins? Or is there another way of implementing this? eg.
the way devise has:
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
end

No comments:

Post a Comment