use model name to determine the type

This commit is contained in:
Lachlan Sylvester
2015-06-12 18:53:47 +10:00
parent de23501995
commit 97e82c3eb7
3 changed files with 7 additions and 3 deletions

View File

@@ -1,6 +1,10 @@
class Model
FILE_DIGEST = Digest::MD5.hexdigest(File.open(__FILE__).read)
def self.model_name
@_model_name ||= ActiveModel::Name.new(self)
end
def initialize(hash={})
@attributes = hash
end