Created
June 3, 2016 00:05
-
-
Save maletor/ef903a286877846a2ab78f78ad4fc175 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def user_includes | |
params[:include].split(',').reduce([]) do |array, relation| | |
array = array | [relation.split('.').reverse.reduce { |a, n| { n => a } }] | |
array & allowed_includes | |
end | |
end | |
def allowed_includes | |
["specialty"] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment