module Findable::Schema::ClassMethods
Public Instance Methods
column_names()
click to toggle source
# File lib/findable/schema.rb, line 16 def column_names @_column_names ||= [:id] end
define_field(*args)
click to toggle source
# File lib/findable/schema.rb, line 28 def define_field(*args) options = args.extract_options! name = args.first if !public_method_defined?(name) || options.present? define_attribute_methods name conversion = Findable::Schema::Conversion.to(options[:type]) define_method(name) { conversion.call(attributes[name.to_sym]) } indexes << name.to_sym if options[:index] column_names << name.to_sym end end
index_defined?()
click to toggle source
# File lib/findable/schema.rb, line 24 def index_defined? indexes.size > 1 end
indexes()
click to toggle source
# File lib/findable/schema.rb, line 20 def indexes @_indexes ||= [:id] end