From eebb9ddf9ba559a510975c486fe59a4edc9da97d Mon Sep 17 00:00:00 2001 From: Patrick Robertson Date: Wed, 1 May 2013 17:10:06 -0700 Subject: Convert ActiveModel to 1.9 hash syntax. I also attempted to fix other styleguide violations such as { a: :b } over {a: :b} and foo(b: 'bar') over foo( b: 'bar' ). --- activemodel/test/models/automobile.rb | 4 ++-- activemodel/test/models/contact.rb | 2 +- activemodel/test/models/reply.rb | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'activemodel/test/models') diff --git a/activemodel/test/models/automobile.rb b/activemodel/test/models/automobile.rb index 021ea61c80..ece644c40c 100644 --- a/activemodel/test/models/automobile.rb +++ b/activemodel/test/models/automobile.rb @@ -7,6 +7,6 @@ class Automobile def validations validates_presence_of :make - validates_length_of :model, :within => 2..10 + validates_length_of :model, within: 2..10 end -end \ No newline at end of file +end diff --git a/activemodel/test/models/contact.rb b/activemodel/test/models/contact.rb index 7bfc542afb..c25be28e1d 100644 --- a/activemodel/test/models/contact.rb +++ b/activemodel/test/models/contact.rb @@ -9,7 +9,7 @@ class Contact end def network - {:git => :github} + { git: :github } end def initialize(options = {}) diff --git a/activemodel/test/models/reply.rb b/activemodel/test/models/reply.rb index ec1efeac19..b77910e671 100644 --- a/activemodel/test/models/reply.rb +++ b/activemodel/test/models/reply.rb @@ -2,11 +2,11 @@ require 'models/topic' class Reply < Topic validate :errors_on_empty_content - validate :title_is_wrong_create, :on => :create + validate :title_is_wrong_create, on: :create validate :check_empty_title - validate :check_content_mismatch, :on => :create - validate :check_wrong_update, :on => :update + validate :check_content_mismatch, on: :create + validate :check_wrong_update, on: :update def check_empty_title errors[:title] << "is Empty" unless title && title.size > 0 -- cgit v1.2.3