Module: ROM::SQL::Plugin::Timestamps::InstanceMethods Private

Defined in:
lib/rom/sql/plugin/timestamps.rb

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 Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ 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.



78
79
80
# File 'lib/rom/sql/plugin/timestamps.rb', line 78

def self.included(base)
  base.before :set_timestamps
end

Instance Method Details

#datestamp_columnsObject

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.



88
89
90
# File 'lib/rom/sql/plugin/timestamps.rb', line 88

def datestamp_columns
  self.class.datestamp_columns
end

#set_timestamps(tuples) ⇒ Array<Hash>, Hash

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.

Set the timestamp attributes on the given tuples

Parameters:

  • tuples (Array<Hash>, Hash)

    the input tuple(s)

Returns:

  • (Array<Hash>, Hash)


99
100
101
102
103
104
105
106
107
108
# File 'lib/rom/sql/plugin/timestamps.rb', line 99

def set_timestamps(tuples, *)
  timestamps = build_timestamps

  case tuples
  when Hash
    timestamps.merge(tuples)
  when Array
    tuples.map { |t| timestamps.merge(t) }
  end
end

#timestamp_columnsObject

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.



83
84
85
# File 'lib/rom/sql/plugin/timestamps.rb', line 83

def timestamp_columns
  self.class.timestamp_columns
end