Module: Hanami::Model::Plugins::Timestamps::ClassMethods Private
- Defined in:
- lib/hanami/model/plugins/timestamps.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class interface
Instance Method Summary collapse
-
#build(relation, options = {}) ⇒ Object
private
Build an input processor according to the current command (create or update).
Instance Method Details
#build(relation, options = {}) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Build an input processor according to the current command (create or update).
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/hanami/model/plugins/timestamps.rb', line 98 def build(relation, = {}) plugin = if self < ROM::Commands::Create InputWithCreateTimestamp else InputWithUpdateTimestamp end wrapped_input = plugin.new(relation, .fetch(:input) { input }) super(relation, .merge(input: wrapped_input)) end |