model_updates 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58b0df924ee01d3ae158b0e10570e783f3720d62
4
- data.tar.gz: 39c786ebecced41a060964cb884bc812dc601161
3
+ metadata.gz: 2a59f8ea4192d5bed3b04a65b1f7bfc2250dc9b1
4
+ data.tar.gz: b430d99789a7ef8c10587148239e8d2f37f6e8d7
5
5
  SHA512:
6
- metadata.gz: 8528ad7fab74214a87c97e898bfaf4c18237e9ac34ae9d9e3a75a38603dda9bfcfbcb4b0dc6a792b7313e25b5a5f73f54a1a7c443cead13baf29db5a1ba4780b
7
- data.tar.gz: a9f3762159877625d2a4b2b5a18206c91e34164635ed55c1a802ac79b2b8b83e9eb545cc56fe2a44349f92b6cf7858864de5e5513a032519df89e76fa40c1246
6
+ metadata.gz: c9e4f946c86f807566a156130fab749921c995ca2cecabaf456abad224edacebe41df5503e656b36b7bd81b7b186dd174141b56e7f1f3a064aef1bbbf961aea4
7
+ data.tar.gz: dad910965e6feb9fea5503d3688db3976eb52bc1920085a65f6f550da29263ff377fcf5eab53578c57c52680e4e512cb505ddb8f785c4db495a95709365246e4
@@ -9,7 +9,12 @@ module ModelUpdates::ModelExtensions
9
9
  changes = {}
10
10
 
11
11
  args.fetch(:attributes).each do |attribute_name|
12
- method_changed = "saved_change_to_#{attribute_name}?"
12
+ if Rails::VERSION::MAJOR >= 5 && Rails::VERSION::MINOR >= 1
13
+ method_changed = "saved_change_to_#{attribute_name}?"
14
+ else
15
+ method_changed = "#{attribute_name}_changed?"
16
+ end
17
+
13
18
  next unless __send__(method_changed)
14
19
  changes[attribute_name] = __send__(attribute_name)
15
20
  end
@@ -1,3 +1,3 @@
1
1
  module ModelUpdates
2
- VERSION = "0.0.2".freeze
2
+ VERSION = "0.0.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: model_updates
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaspernj