Module: SelectableAttrRails::DbLoadable

Defined in:
lib/selectable_attr_rails/db_loadable.rb

Defined Under Namespace

Modules: Entry, InstanceMethods

Instance Method Summary collapse

Instance Method Details

#update_by(*args, &block) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/selectable_attr_rails/db_loadable.rb', line 3

def update_by(*args, &block)
  options = args.last.is_a?(Hash) ? args.pop : {}
  options = {:when => :first_time}.update(options)
  @sql_to_update = block_given? ? block : args.first
  @update_timing = options[:when]
  self.extend(InstanceMethods) unless respond_to?(:update_entries)
end