continuing the refactor of the admin section

This commit is contained in:
2012-12-05 01:14:13 +01:00
parent d8eef4a047
commit fe7c061d37
47 changed files with 752 additions and 123 deletions
@@ -31,6 +31,11 @@ module BjController
def controller_class_name
"#{controller_name.classify.pluralize}Controller"
end
def required_attribute_name
m = model_name.classify.constantize
m.validators.find{|v| v.is_a? ActiveModel::Validations::PresenceValidator }.try(:attributes).try(:first) || m.property_names.find{|k| k !~ /(_id|_at)$/}
end
end
end
end