Module: ResourceRow::TimestampExtensions
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/extensions/concerns/resource_row/timestamp_extensions.rb
Instance Method Summary collapse
Instance Method Details
#column_timestamps ⇒ Object
18 19 20 21 |
# File 'app/extensions/concerns/resource_row/timestamp_extensions.rb', line 18 def ActiveSupport::Deprecation.warn('Do not use table.column_timestamps. Use table.timestamps instead!') end |
#timestamp(attribute_name, options = {}) ⇒ Object
7 8 9 10 11 |
# File 'app/extensions/concerns/resource_row/timestamp_extensions.rb', line 7 def (attribute_name, = {}) .reverse_merge!(format: :short) format = .delete(:format) column(attribute_name) { |resource| I18n.l(resource.send(attribute_name), format: format) if resource.send(attribute_name).present? } end |
#timestamps ⇒ Object
13 14 15 16 |
# File 'app/extensions/concerns/resource_row/timestamp_extensions.rb', line 13 def :created_at :updated_at end |