diff --git a/core/lib/refinery/admin/base_controller.rb b/core/lib/refinery/admin/base_controller.rb index d31e717d49..d0335016e1 100644 --- a/core/lib/refinery/admin/base_controller.rb +++ b/core/lib/refinery/admin/base_controller.rb @@ -41,7 +41,9 @@ def group_by_date(records) records.each do |record| key = record.created_at.strftime("%Y-%m-%d") - record_group = new_records.collect{|records| records.last if records.first == key }.flatten.compact << record + record_group = new_records.map{|r| + r.last if r.first == key + }.flatten.compact << record (new_records.delete_if {|i| i.first == key}) << [key, record_group] end diff --git a/core/lib/refinery/core/engine.rb b/core/lib/refinery/core/engine.rb index d7775f7061..5c586641e0 100644 --- a/core/lib/refinery/core/engine.rb +++ b/core/lib/refinery/core/engine.rb @@ -29,9 +29,9 @@ def refinery_inclusion! config.autoload_paths += %W( #{config.root}/lib ) # Include the refinery controllers and helpers dynamically - config.to_prepare &method(:refinery_inclusion!).to_proc + config.to_prepare(&method(:refinery_inclusion!).to_proc) - after_inclusion &method(:register_decorators!).to_proc + after_inclusion(&method(:register_decorators!).to_proc) # Wrap errors in spans config.to_prepare do diff --git a/core/lib/refinery/ext/action_view/helpers/form_helper.rb b/core/lib/refinery/ext/action_view/helpers/form_helper.rb index 2d764e5d46..07ac0d1145 100644 --- a/core/lib/refinery/ext/action_view/helpers/form_helper.rb +++ b/core/lib/refinery/ext/action_view/helpers/form_helper.rb @@ -7,14 +7,14 @@ def required_label(object_name, method, options = {}) end - def label_humanize_text method, options = {} + def label_humanize_text(method, options = {}) object = options[:object] content ||= if object && object.class.respond_to?(:human_attribute_name) object.class.human_attribute_name(method) end - content ||= method.humanize + content || method.humanize end end