Commit b445d46e by ivan Lan

Fix base controller

parent 4b811198
...@@ -4,13 +4,12 @@ module Shotengai ...@@ -4,13 +4,12 @@ module Shotengai
class << self class << self
# #
# The base_resources of this controller # The base_resources of this controller
# ActiveRecord::Relation or ActiveRecord::Base # ActiveRecord::Base only
def base_resources= resources def base_resources= resources
class_eval %Q{ class_eval %Q{
def add_base_resources def add_base_resources
@base_resources = @base_resources = ::#{resources}
ActiveRecord::Relation === #{resources} ? #{resources} : ::#{resources}
end end
} }
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment