Class: ConfDb::Model::Prop

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/props/db/models.rb

Class Method Summary collapse

Class Method Details

.create_from_fixture!(name, path) ⇒ Object

todo/fix: move create_from_fixture! method to textutils ??? - why? why not? yes - move to textutils! - fixture concept/notion is part of textutils



12
13
14
15
16
17
18
# File 'lib/props/db/models.rb', line 12

def self.create_from_fixture!( name, path )
  key   = "db.#{fixture_name_to_prop_key(name)}.version"
  
  value = "txt.#{File.mtime(path).strftime('%Y.%m.%d')}"
  
  Prop.create!( key: key, value: value )
end