diff --git a/lib/aasm.rb b/lib/aasm.rb index 0a0c370..9a93b02 100644 --- a/lib/aasm.rb +++ b/lib/aasm.rb @@ -13,6 +13,3 @@ require 'ostruct' persistence aasm ).each { |file| require File.join(File.dirname(__FILE__), 'aasm', file) } - -# load the deprecated methods and modules -Dir[File.join(File.dirname(__FILE__), 'aasm', 'deprecated', '*.rb')].sort.each { |f| require File.expand_path(f) } diff --git a/lib/aasm/aasm.rb b/lib/aasm/aasm.rb index e79d9f5..8beca23 100644 --- a/lib/aasm/aasm.rb +++ b/lib/aasm/aasm.rb @@ -133,9 +133,9 @@ module AASM aasm.events(state_name) end - # deprecated + # deprecated, remove this method in v4.0.0 def aasm_human_state - # warn "#aasm_human_state is deprecated and will be removed in version 3.2.0; please use #aasm.human_state instead!" + warn "#aasm_human_state is deprecated and will be removed in version 4.0.0; please use #aasm.human_state instead!" aasm.human_state end diff --git a/lib/aasm/deprecated/aasm.rb b/lib/aasm/deprecated/aasm.rb deleted file mode 100644 index 95a70ac..0000000 --- a/lib/aasm/deprecated/aasm.rb +++ /dev/null @@ -1,15 +0,0 @@ -module AASM - - module ClassMethods - def human_event_name(*args) - warn "AASM.human_event_name is deprecated and will be removed in version 3.1.0; please use AASM.aasm_human_event_name instead!" - aasm_human_event_name(*args) - end - end - - def human_state - warn "AASM#human_state is deprecated and will be removed in version 3.1.0; please use AASM#aasm_human_state instead!" - aasm_human_state - end - -end diff --git a/spec/unit/localizer_spec.rb b/spec/unit/localizer_spec.rb index c31dc33..c8dc178 100644 --- a/spec/unit/localizer_spec.rb +++ b/spec/unit/localizer_spec.rb @@ -52,13 +52,13 @@ describe AASM::Localizer, "new style" do let (:foo_opened) { LocalizerTestModel.new } let (:foo_closed) { LocalizerTestModel.new.tap { |x| x.aasm_state = :closed } } - context 'aasm_human_state' do + context 'aasm.human_state' do it 'should return translated state value' do - foo_opened.aasm_human_state.should == "It's open now!" + foo_opened.aasm.human_state.should == "It's open now!" end it 'should return humanized value if not localized' do - foo_closed.aasm_human_state.should == "Closed" + foo_closed.aasm.human_state.should == "Closed" end end @@ -87,13 +87,13 @@ describe AASM::Localizer, "deprecated style" do let (:foo_opened) { LocalizerTestModel.new } let (:foo_closed) { LocalizerTestModel.new.tap { |x| x.aasm_state = :closed } } - context 'aasm_human_state' do + context 'aasm.human_state' do it 'should return translated state value' do - foo_opened.aasm_human_state.should == "It's open now!" + foo_opened.aasm.human_state.should == "It's open now!" end it 'should return humanized value if not localized' do - foo_closed.aasm_human_state.should == "Closed" + foo_closed.aasm.human_state.should == "Closed" end end