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:
parent
ddaf04f317
commit
70def2bc2c
10
CHANGELOG.md
10
CHANGELOG.md
|
@ -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
|
||||
|
||||
|
|
|
@ -20,6 +20,10 @@ module Ransack
|
|||
def to_model
|
||||
self
|
||||
end
|
||||
|
||||
def model_name
|
||||
self.class.model_name
|
||||
end
|
||||
end
|
||||
|
||||
class Name < String
|
||||
|
|
Loading…
Reference in New Issue