mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56:50 +00:00
Merge pull request #794 from carlesjove/to_param
add to_param for correct URL generation
This commit is contained in:
commit
ba1905a915
4
test/fixtures/poro.rb
vendored
4
test/fixtures/poro.rb
vendored
@ -15,6 +15,10 @@ class Model
|
|||||||
@attributes[:id] || @attributes['id'] || object_id
|
@attributes[:id] || @attributes['id'] || object_id
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def to_param
|
||||||
|
id
|
||||||
|
end
|
||||||
|
|
||||||
def method_missing(meth, *args)
|
def method_missing(meth, *args)
|
||||||
if meth.to_s =~ /^(.*)=$/
|
if meth.to_s =~ /^(.*)=$/
|
||||||
@attributes[$1.to_sym] = args[0]
|
@attributes[$1.to_sym] = args[0]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user