infopark_rails_connector_meta 1.5.2 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/meta.rb +2 -1
- data/lib/meta/channel.rb +22 -0
- data/lib/meta/version.rb +1 -1
- metadata +6 -5
data/lib/meta.rb
CHANGED
data/lib/meta/channel.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# @author Anton Mezin
|
2
|
+
module RailsConnector
|
3
|
+
class Channel < InfoparkBase
|
4
|
+
self.primary_key = "channel_name"
|
5
|
+
|
6
|
+
def self.table_name
|
7
|
+
"#{table_name_prefix}" "channels"
|
8
|
+
end
|
9
|
+
|
10
|
+
has_many :news, :class_name => 'News', :foreign_key => 'channel_name'
|
11
|
+
|
12
|
+
has_many :active_news, :class_name => 'News', :foreign_key => 'channel_name',
|
13
|
+
:conditions => ['valid_from <= :now AND valid_until >= :now', {:now => Time.now.to_s(:number)}]
|
14
|
+
|
15
|
+
has_many :objects, :through => :news
|
16
|
+
|
17
|
+
def self.with_prefix(prefix)
|
18
|
+
scoped.where(["channel_name LIKE ?", "#{prefix}%"])
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
data/lib/meta/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infopark_rails_connector_meta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
8
|
+
- 6
|
9
|
+
- 1
|
10
|
+
version: 1.6.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tomasz Przedmojski
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-01-
|
18
|
+
date: 2013-01-17 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -113,6 +113,7 @@ files:
|
|
113
113
|
- lib/meta/attribute.rb
|
114
114
|
- lib/meta/base.rb
|
115
115
|
- lib/meta/blob_mapping.rb
|
116
|
+
- lib/meta/channel.rb
|
116
117
|
- lib/meta/content.rb
|
117
118
|
- lib/meta/eager_loader.rb
|
118
119
|
- lib/meta/obj_class.rb
|