lib/outpost/controller.rb in outpost-cms-0.0.3 vs lib/outpost/controller.rb in outpost-cms-0.0.4
- old
+ new
@@ -12,11 +12,11 @@
autoload :Filtering
autoload :Preferences
autoload :Authentication
autoload :Authorization
autoload :CustomErrors
-
+
included do
helper_method :list, :model, :fields
end
@@ -114,10 +114,16 @@
def default_fields
model.column_names - Outpost.config.excluded_form_fields
end
def find_model
- self.name.demodulize.underscore.split("_")[0...-1].join("_").classify.constantize
+ self.name
+ .demodulize
+ .underscore
+ .split("_")[0...-1]
+ .join("_")
+ .classify
+ .constantize
end
end # ClassMethods
end # Controller
end # Outpost