Module: FWToolkit::Test::FrankModel::PickleAdapter

Includes:
Pickle::Adapter::Base
Defined in:
lib/fwtoolkit/test/frank_model.rb

Class Method Summary collapse

Class Method Details

.column_names(klass) ⇒ Object

get a list of column names for a given class



66
67
68
# File 'lib/fwtoolkit/test/frank_model.rb', line 66

def self.column_names(klass)
  klass.new.methods
end

.create_model(klass, attributes) ⇒ Object

Create a model using attributes



86
87
88
# File 'lib/fwtoolkit/test/frank_model.rb', line 86

def self.create_model(klass, attributes)
  puts "create_model"
end

.find_all_models(klass, conditions) ⇒ Object

Find all models matching conditions



81
82
83
# File 'lib/fwtoolkit/test/frank_model.rb', line 81

def self.find_all_models(klass, conditions)
  FWToolkit::Test::FrankCache.find_all(klass, conditions)
end

.find_first_model(klass, conditions) ⇒ Object

Find the first instance matching conditions



76
77
78
# File 'lib/fwtoolkit/test/frank_model.rb', line 76

def self.find_first_model(klass, conditions)
  FWToolkit::Test::FrankCache.find_first(klass, conditions)
end

.get_model(klass, id) ⇒ Object

Get an instance by id of the model



71
72
73
# File 'lib/fwtoolkit/test/frank_model.rb', line 71

def self.get_model(klass, id)
  FWToolkit::Test::FrankCache.find(id)
end

.model_classesObject

Gets a list of the available models for this adapter



61
62
63
# File 'lib/fwtoolkit/test/frank_model.rb', line 61

def self.model_classes
  klasses = ::FWToolkit::Test::FrankModel.__send__(:descendants)
end