Class: FieldGroup
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- FieldGroup
- Defined in:
- app/models/fields/field_group.rb
Overview
Copyright © 2008-2013 Michael Dvorkin and contributors.
Fat Free CRM is freely distributable under the terms of MIT license. See MIT-LICENSE file or www.opensource.org/licenses/mit-license.php
Schema Information
Table name: field_groups
id :integer not null, primary key
name :string(64)
label :string(128)
position :integer
hint :string(255)
created_at :datetime
updated_at :datetime
tag_id :integer
klass_name :string(32)
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.with_tags(tag_ids) ⇒ Object
42 43 44 |
# File 'app/models/fields/field_group.rb', line 42 def self.(tag_ids) where 'tag_id IS NULL OR tag_id IN (?)', tag_ids end |
Instance Method Details
#key ⇒ Object
34 35 36 |
# File 'app/models/fields/field_group.rb', line 34 def key "field_group_#{id}" end |
#klass ⇒ Object
38 39 40 |
# File 'app/models/fields/field_group.rb', line 38 def klass klass_name.constantize end |
#label_i18n ⇒ Object
46 47 48 |
# File 'app/models/fields/field_group.rb', line 46 def label_i18n I18n.t(name, default: label) end |