Class: ValidationReflectionTest::Dummy

Inherits:
ActiveRecord::Base show all
Defined in:
lib/vendor/plugins/validation_reflection/test/validation_reflection_test.rb

Class Method Summary collapse

Methods included from Spec::Rails::Extensions::ActiveRecord::ClassMethods

#records

Methods included from Resourceful::Serialize::Model

#serialize, #to_serializable

Methods included from Spec::Rails::Extensions::ActiveRecord::InstanceMethods

#errors_on

Class Method Details

.columnsObject



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/vendor/plugins/validation_reflection/test/validation_reflection_test.rb', line 41

def columns
  [
   create_fake_column('col0'),
   create_fake_column('col1'),
   create_fake_column('col2', false, 100),
   create_fake_column('col3'),
   create_fake_column('col4'),
   create_fake_column('col5'),
   create_fake_column('col6'),
   create_fake_column('col7')
  ]
end

.create_fake_column(name, null = true, limit = nil) ⇒ Object



35
36
37
38
39
# File 'lib/vendor/plugins/validation_reflection/test/validation_reflection_test.rb', line 35

def create_fake_column(name, null = true, limit = nil)
  sql_type = limit ? "varchar (#{limit})" : nil
  col = ActiveRecord::ConnectionAdapters::Column.new(name, nil, sql_type, null)
  col
end