flexible_feeds 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODNkYTFjMTQzMTI1NjUyNzRmY2U2MzYyM2FlMjNhMzkxMWNiODU5NA==
4
+ YTU4MGM5OTAyMjk2NjhkNzE1ODE0M2I1MjNjZTc0MTRiNGY4Yjk2Nw==
5
5
  data.tar.gz: !binary |-
6
- ZWUzNDkzYTNkYmM2NGYyNWQzMzE3OWI5MjIxZWU2MmQxMmY4MmUxOA==
6
+ MTJlYjE3NDY5ZmJkODgwMTYwOTM5MDI2NGMzNDMyMjEzMDdiNzhkNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTZlMjhmOTk1NGI5MDVjZGVjNzE0ZjIxN2ZlM2UxMjIwYjZiNTg1NGQwY2Qx
10
- MjAwNGEyODMyNDA4YzNlOGY2ZDkzMWNkZjZkOTYwMzQ3YjAyMWQyM2NkODZh
11
- YTA5ZjYzYzJlMzU0ZjdhMDBiODllZDg0OTVlOGEzZmNhZDc0MmE=
9
+ M2U1M2QxODgwYjk0ZDJjOWJkM2UyM2RiNTA0ZjYwY2RiY2QyMTJjY2I4MzE0
10
+ YjNhY2VmYjhlZWQxOTEzODA2ODk1MDE2ZDdhYmUyM2RiOWJmOTY5MGI1Yjkx
11
+ OTZiY2Q5NTg3ZTgwNmZjOWZlNDc1OWM5ODVjZDYwYjhiZTY2MjQ=
12
12
  data.tar.gz: !binary |-
13
- ZTcwMzMyZGU3NGIyYTZjNzFjYTY1Yzk5YTczYTZjNDFkY2Q4YzM3MjFkYmQw
14
- ZGQ0Y2U1ZWIzODNjNzc3OTRhNTkxZmQ4ZTgwYmRlZWZjMzAxZjIwYjkyNzU4
15
- Yzc4NzJmNTAxYTIwODMxNjAyYmUyZTcwOWU5MDVkNmI2MWE2ZmI=
13
+ MWNmY2U1YjdmOGJiNWJlMTE3ODcyNDE1MjZlNTg5YTYzN2ZlYTY5MTk4OTgx
14
+ NzZkMDEzZWE3Y2I1MWVkOWZhMDcyMDkwYzdiNzEwOWIzMmYyNjA1OWZmN2U4
15
+ MTlmMmY2NzQ2ZDg1ODRlMDM1N2I1YzYwNmZjMDhiYTg0ZjI5MzY=
@@ -1,9 +1,9 @@
1
1
  module FlexibleFeeds
2
2
  class EventJoin < ActiveRecord::Base
3
- belongs_to :event
4
- belongs_to :feed
3
+ belongs_to :event, class_name: "FlexibleFeeds::Event"
4
+ belongs_to :feed, class_name: "FlexibleFeeds::Feed"
5
5
 
6
- validates :event, presence: true
6
+ validates :event, presence: true, uniqueness: { scope: :feed_id }
7
7
  validates :feed, presence: true
8
8
  validates :sticky, inclusion: { in: [true, false] }
9
9
  end
@@ -9,7 +9,9 @@ class CreateFlexibleFeedsEventJoins < ActiveRecord::Migration
9
9
  end
10
10
 
11
11
  add_index :flexible_feeds_event_joins, :sticky
12
- add_index :flexible_feeds_event_joins, :feed_id
13
- add_index :flexible_feeds_event_joins, :event_id
12
+ add_index :flexible_feeds_event_joins,
13
+ [:event_id, :feed_id],
14
+ unique: true,
15
+ name: "flexible_feeds_event_joins_joinery"
14
16
  end
15
17
  end
@@ -65,7 +65,7 @@ module FlexibleFeeds
65
65
  def create_event_for(destinations)
66
66
  create_event_if_nil
67
67
  destinations.each do |feed|
68
- event.event_joins.create!(feed: feed) if feed.present?
68
+ event.event_joins.where(feed: feed).first_or_create! if feed.present?
69
69
  end
70
70
  end
71
71
  end
@@ -1,3 +1,3 @@
1
1
  module FlexibleFeeds
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flexible_feeds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - timothycommoner