module Cell::Tenant
Public Class Methods
append_features(cls)
click to toggle source
# File lib/cell/tenant.rb, line 34 def self.append_features(cls) cls.prepend(self) end
extend_object(cls)
click to toggle source
# File lib/cell/tenant.rb, line 38 def self.extend_object(cls) cls.prepend(self) end
prepended(model)
click to toggle source
# File lib/cell/tenant.rb, line 42 def self.prepended(model) Cell.assign_model(model) model.extend(ClassMethods) model.prepend(::Cell::Schema) model.prepend(::Cell::Context) model.prepend(::Cell::UrlOptions) end
Public Instance Methods
cell_id()
click to toggle source
# File lib/cell/tenant.rb, line 21 def cell_id send(self.class.cell_id_column) end
cell_id_change_set()
click to toggle source
# File lib/cell/tenant.rb, line 29 def cell_id_change_set fail "cell_id was not changed" unless cell_id_changed? previous_changes[self.class.cell_id_column] end
cell_id_changed?()
click to toggle source
# File lib/cell/tenant.rb, line 25 def cell_id_changed? !! previous_changes[self.class.cell_id_column] end