Sha256: 83627d22ead92f70d5d751f85d250059031c38c6d79698d66adae4e255a82c0a

Contents?: true

Size: 781 Bytes

Versions: 22

Compression:

Stored size: 781 Bytes

Contents

module AbstractAccount
  include_and_extend SimpleRoles
end

# a user account always belongs to one user, a user can have multiple accounts!
class Account < ActiveRecord::Base
  include_and_extend AbstractAccount
  belongs_to :user

end

class UserAccount < Account
  # specifics for normal user account
  tango_user_account # see macros
end

class AdminAccount < Account
  # specifics for admin user account
  tango_user_account

end

# 'belongs' to a Guest user
class GuestAccount
  include_and_extend AbstractAccount

  tango_user_account

  attr_reader :user, :role

  def self.create options
    self.new options
  end

  def initialize options = {}
    options.each_pair do |name, value|
      var = :"@#{name}"
      self.instance_variable_set(var, value)
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
cantango-0.9.4.7 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.9.4.6 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.9.4.5 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.9.4.3 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.9.4.2 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.9.4.1 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.9.4 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.9.3.2 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.9.5 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.9.4 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.9.3 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.9.2 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.9.1 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.9 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.8.1 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.8 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.7 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.6.2 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.6.1 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb
cantango-0.8.6 spec/active_record/scenarios/user_accounts/helpers/account_setup.rb