class Object

Public Instance Methods

column() click to toggle source
# File lib/remockable/active_record/have_column.rb, line 6
def column
  @column ||= subject.class.columns_hash[attribute.to_s]
end
column_names() click to toggle source
# File lib/remockable/active_record/have_index.rb, line 6
def column_names
  @column_names ||= expected_as_array.flatten.collect(&:to_s)
end
matches_name?(index, name) click to toggle source
# File lib/remockable/active_record/have_index.rb, line 31
def matches_name?(index, name)
  index.name == name.to_s
end
method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/remockable/active_record/have_default_scope.rb, line 31
def method_missing(method, *args, &block)
  unsupported_query_methods = %w(
    create_with
    eager_load
    includes
    lock
    preload
    readonly
  )

  query_methods = %w(
    from
    group
    having
    joins
    limit
    offset
    order
    reorder
    select
    where
  ).collect(&:to_sym)

  if query_methods.include?(method)
    self.relation ||= subject.class.unscoped
    self.relation = relation.send(method, *args)
    self
  else
    super
  end
end
normalized_options() click to toggle source
# File lib/remockable/active_model/validate_length_of.rb, line 33
def normalized_options
  options.dup.tap do |options|
    if within = options.delete(:within) || options.delete(:in)
      options[:minimum] = within.first
      options[:maximum] = within.last
    end
  end
end
values() click to toggle source
# File lib/remockable/active_model/allow_values_for.rb, line 4
def values
  expected_as_array[1..-1]
end