Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Commit

Permalink
Add monkey patch to statemachine to make #around_validation public (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
kcurtin committed Jun 25, 2014
1 parent 5879ad6 commit 3c1f86a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/has_messages.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
require 'state_machine'
# Rails 4.1.0.rc1 and StateMachine don't play nice
# https://github.com/pluginaweek/state_machine/issues/295
unless StateMachine::VERSION == '1.2.0'
# If you see this message, please test removing this file
# If it's still required, please bump up the version above
puts "Please remove me, StateMachine version has changed"
end

module StateMachine::Integrations::ActiveModel
public :around_validation
end

# Adds a generic implementation for sending messages between users
module HasMessages
Expand Down Expand Up @@ -76,7 +87,7 @@ def sent_messages
messages.with_states(:queued, :sent)
end
end

module ActsAsMessageTopicInstanceMethods
def topical_messages_for(receiver, recipient_state = nil)
recipients_filter = MessageRecipient.with_receiver(receiver)
Expand Down

0 comments on commit 3c1f86a

Please sign in to comment.