Class: Multitenant::Mysql::Configs::Bucket
- Inherits:
-
Object
- Object
- Multitenant::Mysql::Configs::Bucket
- Defined in:
- lib/multitenant-mysql/configs/bucket.rb
Constant Summary collapse
- DEFAULT_TENANT_NAME_ATTR =
[:name, :title]
Instance Attribute Summary collapse
-
#field ⇒ Object
Returns the value of attribute field.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ Bucket
constructor
A new instance of Bucket.
- #model ⇒ Object
Constructor Details
#initialize(name) ⇒ Bucket
Returns a new instance of Bucket.
8 9 10 |
# File 'lib/multitenant-mysql/configs/bucket.rb', line 8 def initialize(name) @name = name end |
Instance Attribute Details
#field ⇒ Object
Returns the value of attribute field.
6 7 8 |
# File 'lib/multitenant-mysql/configs/bucket.rb', line 6 def field @field end |
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/multitenant-mysql/configs/bucket.rb', line 6 def name @name end |
Instance Method Details
#model ⇒ Object
12 13 14 15 16 17 18 19 20 |
# File 'lib/multitenant-mysql/configs/bucket.rb', line 12 def model @name.constantize rescue if @name.blank? raise InvalidBucketError.new('Multitenant::Mysql: You should specify model which stores info about tenants.') else raise InvalidBucketError.new("Please check your multitenant-mysql configs. Seems like you are trying to use model which doesn't exist: #{@name}") end end |