Hello. First of all, thank you for creating such a nice library!
I would like to report that I encountered an error with ransackable_scopes in my project.
Version
ransack 2.4.2
Rails 6.1.4.1
Ruby 2.6.3p62
Reproduction
Create a scope that takes a date type as an argument, and set it to ransackable_scopes.
# article.rb
class Article < ApplicationRecord
scope :created_since, -> (date) {
where('created_at >= ?', date)
}
def self.ransackable_scopes(auth_object = nil)
%i[created_since]
end
end
# search_controller.rb
class SearchController < ApplicationController
def index
@q = Article.ransack(params[:q])
end
end
Add a search field using this scope in view with date_field.
Hello. First of all, thank you for creating such a nice library! I would like to report that I encountered an error with
ransackable_scopes
in my project.Version
Reproduction
Create a scope that takes a date type as an argument, and set it to
ransackable_scopes
.date_field
.I have checked this behavior in the repository here. ransackable_scopes by kenzo-tanaka · Pull Request #12 · kenzo-tanaka/rails_sandbox
I'm sorry if I misunderstood.