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 CHANGED
@@ -5,4 +5,5 @@ require 'meta/attribute'
5
5
  require 'meta/object_with_meta_data'
6
6
  require 'meta/content'
7
7
  require 'meta/version'
8
- require 'meta/blob_mapping'
8
+ require 'meta/blob_mapping'
9
+ require 'meta/channel'
@@ -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
@@ -1,5 +1,5 @@
1
1
  module RailsConnector
2
2
  module Meta
3
- VERSION = "1.5.2"
3
+ VERSION = "1.6.1"
4
4
  end
5
5
  end
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: 7
4
+ hash: 13
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 5
9
- - 2
10
- version: 1.5.2
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-09 00:00:00 +01:00
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