Module: ActiveRecord::Tablefree::InstanceMethods

Defined in:
lib/activerecord/tablefree.rb

Instance Method Summary collapse

Instance Method Details

#add_to_transactionObject


215
# File 'lib/activerecord/tablefree.rb', line 215

def add_to_transaction; end

#destroyObject


196
197
198
199
200
201
202
203
204
# File 'lib/activerecord/tablefree.rb', line 196

def destroy
  case self.class.tablefree_options[:database]
  when :pretend_success
    @destroyed = true
    freeze
  when :fail_fast
    raise NoDatabase, "Can't #destroy a Tablefree object"
  end
end

#quote_value(_value, _column = nil) ⇒ Object


181
182
183
# File 'lib/activerecord/tablefree.rb', line 181

def quote_value(_value, _column = nil)
  ''
end

#reload(*_args) ⇒ Object


206
207
208
209
210
211
212
213
# File 'lib/activerecord/tablefree.rb', line 206

def reload(*_args)
  case self.class.tablefree_options[:database]
  when :pretend_success
    self
  when :fail_fast
    raise NoDatabase, "Can't #reload a Tablefree object"
  end
end

#to_query_string(prefix = nil) ⇒ Object


177
178
179
# File 'lib/activerecord/tablefree.rb', line 177

def to_query_string(prefix = nil)
  attributes.to_a.collect { |(name, value)| escaped_var_name(name, prefix) + '=' + escape_for_url(value) if value }.compact.join('&')
end