On Tuesday, March 17, 2015 at 8:15:23 AM UTC-7, Janko Marohnić wrote:
>
> Well, the problem is that, since I'm making a gem that extends Refile with 
> Sequel, I don't know if users will call `save` or `save_changes/update` (if 
> it was only me, I would be ok with it). I would like that the thing works 
> when they do either. Especially I think they will use `update` in the 
> controller, since it combines `set` and `save` into a single command.
>

Here's one way:

class Sequel::Model
  def save_changes
    save
  end
end 

If you don't want to affect save_changes in general, you can just call 
modified! on the model instance, and save_changes will then call save.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to