Module: Billfold

Defined in:
lib/billfold.rb,
lib/billfold/user.rb,
lib/billfold/engine.rb,
lib/billfold/identity.rb,
lib/billfold/active_record_user.rb,
lib/billfold/controller_support.rb,
lib/billfold/active_record_identity.rb,
app/controllers/billfold/identities_controller.rb,
lib/rails/generators/billfold/models_generator.rb,
lib/rails/generators/billfold/migration_generator.rb

Defined Under Namespace

Modules: ActiveRecordIdentity, ActiveRecordUser, ControllerSupport, Identity, User Classes: Engine, IdentitiesController, MigrationGenerator, ModelsGenerator

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.identity_class_nameObject



36
37
38
# File 'lib/billfold.rb', line 36

def identity_class_name
  @identity_class ||= 'Identity'
end

.user_class_nameObject

Used by ‘Billfold::ActiveRecordIdentity` for the `belongs_to :user` association and by `Billfold.user_class` for getting the actual class. By default, “User”



22
23
24
# File 'lib/billfold.rb', line 22

def user_class_name
  @user_class ||= 'User'
end

Class Method Details

.identity_classObject

## Billfold.identity_class

Used by ‘Billfold::IdentitiesController.update_or_create`. Calculated from `Billfold.identity_class_name`.



32
33
34
# File 'lib/billfold.rb', line 32

def identity_class
  constantize identity_class_name
end

.user_classObject

## Billfold.user_class

Used by ‘Billfold::Identity.update_or_create!` when building new users and `Billfold::ControllerSupport` when looking up the current user from the session. Calculated from `Billfold.user_class_name`.



15
16
17
# File 'lib/billfold.rb', line 15

def user_class
  constantize user_class_name
end