Sha256: 3763cd388474b97475a6c442ca912e745ce793345feab1bb8c97c60c01a0f171

Contents?: true

Size: 712 Bytes

Versions: 8

Compression:

Stored size: 712 Bytes

Contents

# == Schema Information
#
# Table name: export_templates
#
#  id              :integer          not null, primary key
#  user_id         :integer
#  class_type      :string(255)
#  schema_template :text
#  active          :boolean          default(FALSE), not null
#  position        :integer
#  created_at      :datetime
#  updated_at      :datetime
#

class ExportTemplate < ActiveRecord::Base
  belongs_to :user, inverse_of: :export_templates

  validates :name, presence: true,  :uniqueness => { :scope => :class_type }

  serialize :schema_template

  validates :active, inclusion: [true, false]

  default_scope -> { order 'export_templates.position ASC' }

  scope :active, -> { where(active: true) }
end

Version data entries

8 entries across 4 versions & 1 rubygems

Version Path
basepack-1.0.1 lib/generators/basepack/templates/export_template.rb
basepack-1.0.1 spec/dummy_app/app/models/export_template.rb
basepack-1.0.0 lib/generators/basepack/templates/export_template.rb
basepack-1.0.0 spec/dummy_app/app/models/export_template.rb
basepack-1.0.0.pre.0 lib/generators/basepack/templates/export_template.rb
basepack-1.0.0.pre.0 spec/dummy_app/app/models/export_template.rb
basepack-0.2.0 lib/generators/basepack/templates/export_template.rb
basepack-0.2.0 spec/dummy_app/app/models/export_template.rb