Skip to content

Commit

Permalink
removed deprecated methods (mostly the ones prefixed with )
Browse files Browse the repository at this point in the history
  • Loading branch information
alto committed Nov 5, 2014
1 parent 710790a commit e9a7686
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 98 deletions.
3 changes: 0 additions & 3 deletions AASM4.md

This file was deleted.

1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -18,6 +18,7 @@
* **DSL change**: instance-based permissible_events has been removed in favor or events(:permissible => true)
* **DSL change**: class-based events now returns a list of Event instances (instead of a hash with event names as keys)
* **DSL change**: renamed permissible states and events to permitted states events
* removed deprecated methods (mostly the ones prefixed with `aasm_`)

## 3.4.0

Expand Down
7 changes: 7 additions & 0 deletions PLANNED_CHANGES.md
@@ -0,0 +1,7 @@
# Planned changes for AASM 4.1

* remove support for `:on_transition` callback

# Planned changes for AASM 4.0

* nothing left
89 changes: 0 additions & 89 deletions lib/aasm/aasm.rb
Expand Up @@ -26,59 +26,6 @@ def aasm(options={}, &block)
@aasm
end

# TODO remove this method in v4.0.0
def aasm_initial_state(set_state=nil)
if set_state
warn ".aasm_initial_state(:name) is deprecated and will be removed in version 4.0.0; please use .aasm.initial_state = :name instead!"
AASM::StateMachine[self].initial_state = set_state
else
warn ".aasm_initial_state is deprecated and will be removed in version 4.0.0; please use .aasm.initial_state instead!"
AASM::StateMachine[self].initial_state
end
end

# TODO remove this method in v4.0.0
def aasm_from_states_for_state(state, options={})
warn ".aasm_from_states_for_state is deprecated and will be removed in version 4.0.0; please use .aasm.from_states_for_state instead!"
aasm.from_states_for_state(state, options)
end

# TODO remove this method in v4.0.0
def aasm_initial_state=(state)
warn ".aasm_initial_state= is deprecated and will be removed in version 4.0.0"
AASM::StateMachine[self].initial_state = state
end

# TODO remove this method in v4.0.0
def aasm_state(name, options={})
warn ".aasm_state is deprecated and will be removed in version 4.0.0; please use .aasm.state instead!"
aasm.state(name, options)
end

# TODO remove this method in v4.0.0
def aasm_event(name, options = {}, &block)
warn ".aasm_event is deprecated and will be removed in version 4.0.0; please use .aasm.event instead!"
aasm.event(name, options, &block)
end

# TODO remove this method in v4.0.0
def aasm_states
warn ".aasm_states is deprecated and will be removed in version 4.0.0; please use .aasm.states instead!"
aasm.states
end

# TODO remove this method in v4.0.0
def aasm_events
warn ".aasm_events is deprecated and will be removed in version 4.0.0; please use .aasm.events instead!"
aasm.events
end

# TODO remove this method in v4.0.0
def aasm_states_for_select
warn ".aasm_states_for_select is deprecated and will be removed in version 4.0.0; please use .aasm.states_for_select instead!"
aasm.states_for_select
end

# aasm.event(:event_name).human?
def aasm_human_event_name(event) # event_name?
AASM::Localizer.new.human_event_name(self, event)
Expand Down Expand Up @@ -107,42 +54,6 @@ def aasm_write_state_without_persistence(new_state)
true
end

# TODO remove this method in v4.0.0
def aasm_current_state
warn "#aasm_current_state is deprecated and will be removed in version 4.0.0; please use #aasm.current_state instead!"
aasm.current_state
end

# TODO remove this method in v4.0.0
def aasm_enter_initial_state
warn "#aasm_enter_initial_state is deprecated and will be removed in version 4.0.0; please use #aasm.enter_initial_state instead!"
aasm.enter_initial_state
end

# TODO remove this method in v4.0.0
def aasm_events_for_current_state
warn "#aasm_events_for_current_state is deprecated and will be removed in version 4.0.0; please use #aasm.events(aasm.current_state) instead!"
aasm.events(aasm.current_state)
end

# TODO remove this method in v4.0.0
def aasm_permissible_events_for_current_state
warn "#aasm_permissible_events_for_current_state is deprecated and will be removed in version 4.0.0; please use #aasm.events(:permitted => true) instead!"
aasm.events(:permitted => true)
end

# TODO remove this method in v4.0.0
def aasm_events_for_state(state_name)
warn "#aasm_events_for_state(state_name) is deprecated and will be removed in version 4.0.0; please use #aasm.events(state_name) instead!"
aasm.events(state_name)
end

# TODO remove this method in v4.0.0
def aasm_human_state
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

private

# Takes args and a from state and removes the first
Expand Down
6 changes: 0 additions & 6 deletions lib/aasm/event.rb
Expand Up @@ -39,12 +39,6 @@ def transitions_to_state(state)
@transitions.select { |t| t.to == state }
end

# TODO remove this method in v4.0.0
def all_transitions
warn "Event#all_transitions is deprecated and will be removed in version 4.0.0; please use Event#transitions instead!"
transitions
end

def fire_callbacks(callback_name, record, *args)
# strip out the first element in args if it's a valid to_state
# #given where we're coming from, this condition implies args not empty
Expand Down

0 comments on commit e9a7686

Please sign in to comment.