Module: Lolita::Adapter::FieldHelper

Included in:
ActiveRecord::Field, Mongoid::Field
Defined in:
lib/lolita/adapter/field_helper.rb

Instance Method Summary collapse

Instance Method Details

#content?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/lolita/adapter/field_helper.rb', line 14

def content?
  !technical?
end

#technical?Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
# File 'lib/lolita/adapter/field_helper.rb', line 4

def technical?
  if self.name.to_s.match(/^created_at|updated_at|type$/)
    true
  elsif self.primary?
    true
  elsif adapter.klass.respond_to?(:uploaders)
    adapter.klass.uploaders.keys.include?(name.to_sym)
  end
end