Skip to content

ActiveAdminDatetimepicker::Base mattr_accessor :format defaults to nil #20

@gbirchmeier

Description

@gbirchmeier

(version 0.2.0, rails 4.0.14, ruby 2.1.0, activeadmin 1.0.0.pre1)

If I don't explicitly set ActiveAdminDatetimepicker::Base.format = "%Y-%m-%d %H:%M" in an initializer, I get this exception when I submit my form or load the edit-object form:

no implicit conversion of nil into String

top of framework trace:
  active_admin_datetimepicker (0.2.0) lib/active_admin_datetimepicker/base.rb:31:in `strftime'
  active_admin_datetimepicker (0.2.0) lib/active_admin_datetimepicker/base.rb:31:in `input_value'
  active_admin_datetimepicker (0.2.0) lib/active_admin_datetimepicker/base.rb:24:in `input_html_options'

I traced this to lib/active_admin_datetimepicker/base.rb line 31. The variable format is nil.

It appears that the mattr_accessor :format block (same file) is supposed to set a default value for format, but my experience today is that it's not doing anything.

UPDATE:

(from #19) mattr_accessor :default_datetime_picker_options has the same defect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions