permitir guardar artículos con campos de solo lectura
This commit is contained in:
parent
b9f7dc4826
commit
6e9b333cd5
1 changed files with 4 additions and 2 deletions
|
@ -378,8 +378,10 @@ class Post
|
|||
|
||||
# Ejecuta la acción de guardado en cada atributo.
|
||||
def save_attributes!
|
||||
attributes.map do |attr|
|
||||
self[attr].writable? && self[attr].save
|
||||
attributes.select do |attr|
|
||||
self[attr].writable?
|
||||
end.map do |attr|
|
||||
self[attr].save
|
||||
end.all?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue