simple_like 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  module SimpleLike
2
2
  module Target
3
3
  def simple_like
4
- has_many :likes, { as: :likeable, dependent: :destroy, class_name: 'Like' }
4
+ has_many :likes, { as: :likeable, dependent: :destroy }
5
5
  end
6
6
 
7
7
  def is_likeable
@@ -2,8 +2,7 @@ module SimpleLike
2
2
  module User
3
3
  def like!(instance)
4
4
  if is_likeable?(instance)
5
- instance.likes << Like.new(author: self) if !like?(instance)
6
- instance.save!
5
+ instance.likes.create(author: self) if !like?(instance)
7
6
  else
8
7
  # Return exception
9
8
  end
@@ -1,3 +1,3 @@
1
1
  module SimpleLike
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_like
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.2.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: