Sha256: 3e7187e47f8939f0aced5a2d0f0d7ae7c41c3727f311269f047f6faf03332153
Contents?: true
Size: 862 Bytes
Versions: 16
Compression:
Stored size: 862 Bytes
Contents
class Company < AbstractAdapter has_many :roles, as: :ownable has_many :admins, through: :roles, source: :user accepts_nested_attributes_for :roles, allow_destroy: true has_many :beacons, class_name: 'LocationBeacon', dependent: :destroy has_many :locatables has_many :locations, through: :locatables, source: :locatable, source_type: 'Company' has_many :projects, foreign_key: :owner_id, dependent: :destroy, inverse_of: :owner validates_length_of :name, maximum: 256 validates_length_of :short_name, maximum: 10 def self.grape_validations { gizmos: { json: true }, widgets: { json_array: true }, sprockets: { json_hash: true } } end def gizmos=(json) JSON.parse(json) end def widgets=(json_array) JSON.parse(json_array) end def sprockets=(json_hash) JSON.parse(json_hash) end end
Version data entries
16 entries across 16 versions & 1 rubygems