flexible_feeds 0.3.4 → 0.3.5
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.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTU4MGM5OTAyMjk2NjhkNzE1ODE0M2I1MjNjZTc0MTRiNGY4Yjk2Nw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MTJlYjE3NDY5ZmJkODgwMTYwOTM5MDI2NGMzNDMyMjEzMDdiNzhkNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2U1M2QxODgwYjk0ZDJjOWJkM2UyM2RiNTA0ZjYwY2RiY2QyMTJjY2I4MzE0
|
10
|
+
YjNhY2VmYjhlZWQxOTEzODA2ODk1MDE2ZDdhYmUyM2RiOWJmOTY5MGI1Yjkx
|
11
|
+
OTZiY2Q5NTg3ZTgwNmZjOWZlNDc1OWM5ODVjZDYwYjhiZTY2MjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
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,
|
13
|
-
|
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.
|
68
|
+
event.event_joins.where(feed: feed).first_or_create! if feed.present?
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|