Fix #518: undefined method `model_name`

A better solution by Gleb Mazovetskiy for issue #518 "undefined method
`model_name' for Ransack::Search" which affected Rails 4.2.1 and 5.0.0.

This fix allows us to remove the ActionView patch added 10 days ago in
Ransack 1.6.4.

Closes #518.
This commit is contained in:
Jon Atack 2015-03-31 21:25:55 +05:30
parent ddaf04f317
commit 70def2bc2c
2 changed files with 14 additions and 0 deletions

View File

@ -1,5 +1,15 @@
# Change Log
## Unreleased
### Fixed
* A better fix for the "undefined method `model_name' for Ransack::Search"
issue [#518](https://github.com/activerecord-hackery/ransack/issues/518)
affecting Rails 4.2.1 and 5.0.0. This fix allows us to remove the
ActionView patch in Ransack version 1.6.4.
*Gleb Mazovetskiy*
## Version 1.6.5 - 2015-03-28 - Rails 5.0.0 update
### Added

View File

@ -20,6 +20,10 @@ module Ransack
def to_model
self
end
def model_name
self.class.model_name
end
end
class Name < String