Module: ActiveInteraction

Defined in:
lib/roqua/core_ext/active_interaction/filters/duration_filter.rb

Defined Under Namespace

Classes: Base, DurationFilter

Class Method Summary collapse

Class Method Details

.duration(*attributes, options = {}) ⇒ Object

Creates accessors for the attributes and ensures that the value passed to

the attributes is a  ActiveSupport::Duration.

Value can be a hash with a value and unit key

Examples:

duration :first_name
duration :first_name, strip: true

Options Hash (options):

  • :strip (Boolean) — default: false

    Make nil if value is 0.



# File 'lib/roqua/core_ext/active_interaction/filters/duration_filter.rb', line 7