Sha256: 9a056c1f487e754aecd8cd75f381ad71ecbef1f8c6383f321a90c78be40250f3
Contents?: true
Size: 610 Bytes
Versions: 1
Compression:
Stored size: 610 Bytes
Contents
# == Schema Information # # Table name: default_categories # # id :integer not null, primary key # organization_id :integer not null # name :string(255) not null # created_at :datetime # updated_at :datetime # class DefaultCategory < ActiveRecord::Base belongs_to :organization validates :name, presence: true, uniqueness: { scope: :organization_id }, length: { maximum: 255 } validates :organization, presence: true def last_for_organization? organization.categories.where("default_categories.id != ?", id).count == 0 end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
self_systeem-0.1.0 | test/dummy_app/app/models/default_category.rb |