Merge pull request #794 from carlesjove/to_param

add to_param for correct URL generation
This commit is contained in:
Alexandre de Oliveira 2015-01-30 11:06:33 -02:00
commit ba1905a915

View File

@ -15,6 +15,10 @@ class Model
@attributes[:id] || @attributes['id'] || object_id
end
def to_param
id
end
def method_missing(meth, *args)
if meth.to_s =~ /^(.*)=$/
@attributes[$1.to_sym] = args[0]