From 26a6bd54e225fd6c77e47a2b11543fd92bb7ed4f Mon Sep 17 00:00:00 2001 From: Lillie Chilen Date: Fri, 10 Apr 2015 11:01:05 -0700 Subject: [PATCH] Remove 'invalid' translation from locale specification - And update documentation --- lib/state_machine/integrations/active_model.rb | 3 +-- lib/state_machine/integrations/active_model/locale.rb | 1 - lib/state_machine/integrations/active_record.rb | 3 +-- lib/state_machine/integrations/mongo_mapper.rb | 3 +-- lib/state_machine/integrations/mongoid.rb | 3 +-- 5 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/state_machine/integrations/active_model.rb b/lib/state_machine/integrations/active_model.rb index 769c4b3a..0a865746 100644 --- a/lib/state_machine/integrations/active_model.rb +++ b/lib/state_machine/integrations/active_model.rb @@ -242,7 +242,6 @@ module Integrations #:nodoc: # activemodel: # errors: # messages: - # invalid: "is invalid" # # %{value} = attribute value, %{state} = Human state name # invalid_event: "cannot transition when %{state}" # # %{value} = attribute value, %{event} = Human event name, %{state} = Human current state name @@ -255,7 +254,7 @@ module Integrations #:nodoc: # errors: # models: # user: - # invalid: "is not valid" + # invalid_event: "is not valid" # # In addition to the above, you can also provide translations for the # various states / events in each state machine. Using the Vehicle example, diff --git a/lib/state_machine/integrations/active_model/locale.rb b/lib/state_machine/integrations/active_model/locale.rb index e5a9f4d3..0249eecd 100644 --- a/lib/state_machine/integrations/active_model/locale.rb +++ b/lib/state_machine/integrations/active_model/locale.rb @@ -2,7 +2,6 @@ :activemodel => { :errors => { :messages => { - :invalid => StateMachine::Machine.default_messages[:invalid], :invalid_event => StateMachine::Machine.default_messages[:invalid_event] % ['%{state}'], :invalid_transition => StateMachine::Machine.default_messages[:invalid_transition] % ['%{event}'] } diff --git a/lib/state_machine/integrations/active_record.rb b/lib/state_machine/integrations/active_record.rb index 8f21dd41..dcfa9ca4 100644 --- a/lib/state_machine/integrations/active_record.rb +++ b/lib/state_machine/integrations/active_record.rb @@ -368,7 +368,6 @@ module Integrations #:nodoc: # activerecord: # errors: # messages: - # invalid: "is invalid" # # %{value} = attribute value, %{state} = Human state name # invalid_event: "cannot transition when %{state}" # # %{value} = attribute value, %{event} = Human event name, %{state} = Human current state name @@ -384,7 +383,7 @@ module Integrations #:nodoc: # errors: # models: # user: - # invalid: "is not valid" + # invalid_event: "is not valid" # # In addition to the above, you can also provide translations for the # various states / events in each state machine. Using the Vehicle example, diff --git a/lib/state_machine/integrations/mongo_mapper.rb b/lib/state_machine/integrations/mongo_mapper.rb index 132dec50..989d298f 100644 --- a/lib/state_machine/integrations/mongo_mapper.rb +++ b/lib/state_machine/integrations/mongo_mapper.rb @@ -258,7 +258,6 @@ module Integrations #:nodoc: # mongo_mapper: # errors: # messages: - # invalid: "is invalid" # # %{value} = attribute value, %{state} = Human state name # invalid_event: "cannot transition when %{state}" # # %{value} = attribute value, %{event} = Human event name, %{state} = Human current state name @@ -271,7 +270,7 @@ module Integrations #:nodoc: # errors: # models: # user: - # invalid: "is not valid" + # invalid_event: "is not valid" # # In addition to the above, you can also provide translations for the # various states / events in each state machine. Using the Vehicle example, diff --git a/lib/state_machine/integrations/mongoid.rb b/lib/state_machine/integrations/mongoid.rb index 877fb9fd..4c3897f3 100644 --- a/lib/state_machine/integrations/mongoid.rb +++ b/lib/state_machine/integrations/mongoid.rb @@ -308,7 +308,6 @@ module Integrations #:nodoc: # mongoid: # errors: # messages: - # invalid: "is invalid" # # %{value} = attribute value, %{state} = Human state name # invalid_event: "cannot transition when %{state}" # # %{value} = attribute value, %{event} = Human event name, %{state} = Human current state name @@ -321,7 +320,7 @@ module Integrations #:nodoc: # errors: # models: # user: - # invalid: "is not valid" + # invalid_event: "is not valid" # # In addition to the above, you can also provide translations for the # various states / events in each state machine. Using the Vehicle example,