Module: ActiveType::NoTable::ClassMethods

Defined in:
lib/active_type/no_table.rb,
lib/active_type/no_table.rb

Instance Method Summary collapse

Instance Method Details

#_query_by_sqlObject



151
152
153
# File 'lib/active_type/no_table.rb', line 151

def _query_by_sql(*)
  []
end

#cached_find_byObject



155
156
157
# File 'lib/active_type/no_table.rb', line 155

def cached_find_by(*)
  nil
end

#column_typesObject



11
12
13
# File 'lib/active_type/no_table.rb', line 11

def column_types
  {}
end

#columnsObject



15
16
17
# File 'lib/active_type/no_table.rb', line 15

def columns
  []
end

#connectionObject



131
132
133
# File 'lib/active_type/no_table.rb', line 131

def connection
  @connection ||= DummyConnection.new(nil)
end

#destroyObject



23
24
25
# File 'lib/active_type/no_table.rb', line 23

def destroy(*)
  new
end

#destroy_allObject



27
28
29
# File 'lib/active_type/no_table.rb', line 27

def destroy_all(*)
  []
end

#find_by_sqlObject



31
32
33
# File 'lib/active_type/no_table.rb', line 31

def find_by_sql(*)
  []
end

#primary_keyObject



19
20
21
# File 'lib/active_type/no_table.rb', line 19

def primary_key
  nil
end

#schema_cacheObject



159
160
161
# File 'lib/active_type/no_table.rb', line 159

def schema_cache
  DummySchemaCache.new
end

#with_connection {|connection| ... } ⇒ Object

Yields:



135
136
137
# File 'lib/active_type/no_table.rb', line 135

def with_connection(**)
  yield(connection)
end