Skip to content

this plugin breaks searchlogic datetime search w/date #2

@spovich

Description

@spovich

SearchLogic uses a feature of ActiveRecord to do casting of dates. However, with this plugin, ActiveRecord no longer returns the result of the cast. This totally breaks SearchLogic searches on DateTime fields when you only provide a Date value.

If you have a rails app with this plugin, just do the following to see the problem:

# script/console
# c = ::ActiveRecord::ConnectionAdapters::Column.new("", nil)
# c.instance_variable_set(:@type, :datetime)
# c.type_cast("Jan 1, 2009")

without validates_date_time plugin installed
=> Thu Jan 01 00:00:00 UTC 2009

but with validates_date_time plugin installed
=> nil

I am trying to fix this, but wanted to raise the issue in case someone else already knows of this and a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions