listable 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -1,13 +1,6 @@
1
- #require 'rake'
2
-
3
1
  module Listable
4
2
  class Railtie < Rails::Railtie
5
3
  initializer "listable" do
6
- # Rebuild views after db:migrate
7
- # Rake::Task['db:migrate'].enhance do
8
- # Rake::Task['listable:migrate'].invoke
9
- # end
10
-
11
4
  ActiveSupport.on_load :active_record do
12
5
  # Extending connection adapters
13
6
  if ActiveRecord::ConnectionAdapters.const_defined?(:PostgreSQLAdapter)
@@ -32,7 +32,7 @@ module Listable
32
32
  query = model_class.select_as(id: :listable_id) # Always begin selection with the original model ID
33
33
  query = query.send(scope) # Appends selection from scope
34
34
  query = query.select([:created_at, :updated_at]) # Include Rails' timestamps in view
35
- query = query.select("CAST('#{model_name}' AS char) AS listable_type") # Finish with the original model name, needed for the polymorphic relation
35
+ query = query.select("CAST('#{model_name}' AS char(255)) AS listable_type") # Finish with the original model name, needed for the polymorphic relation
36
36
 
37
37
  queries << query
38
38
  end
data/listable.gemspec ADDED
@@ -0,0 +1,67 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = "listable"
8
+ s.version = "0.1.2"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Johannes Baldursson"]
12
+ s.date = "2013-01-30"
13
+ s.description = "With listable you can consolidate fields from several models into one, backed up by a database view.\n It is perfect for e.g. a front page where you may want to display the most recent additions to your site in a joint list.\n By providing scopes for each model you wish to include in a view, Listable will automatically create the database view for you."
14
+ s.email = "johannes.baldursson@gmail.com"
15
+ s.extra_rdoc_files = [
16
+ "LICENSE.txt",
17
+ "README.rdoc"
18
+ ]
19
+ s.files = [
20
+ ".document",
21
+ "Gemfile",
22
+ "Gemfile.lock",
23
+ "LICENSE.txt",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "lib/listable.rb",
28
+ "lib/listable/connection_adapters.rb",
29
+ "lib/listable/querying.rb",
30
+ "lib/listable/railtie.rb",
31
+ "lib/listable/view_manager.rb",
32
+ "lib/tasks/listable.rake",
33
+ "listable.gemspec",
34
+ "test/helper.rb",
35
+ "test/test_listable.rb"
36
+ ]
37
+ s.homepage = "http://github.com/baldursson/listable"
38
+ s.licenses = ["MIT"]
39
+ s.require_paths = ["lib"]
40
+ s.rubygems_version = "1.8.10"
41
+ s.summary = "Rails extension that makes it easy to list and query several models through a single view backed model."
42
+
43
+ if s.respond_to? :specification_version then
44
+ s.specification_version = 3
45
+
46
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
47
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
48
+ s.add_development_dependency(%q<rdoc>, ["~> 3.12"])
49
+ s.add_development_dependency(%q<bundler>, ["~> 1.2.3"])
50
+ s.add_development_dependency(%q<jeweler>, ["~> 1.8.4"])
51
+ s.add_development_dependency(%q<simplecov>, [">= 0"])
52
+ else
53
+ s.add_dependency(%q<shoulda>, [">= 0"])
54
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
55
+ s.add_dependency(%q<bundler>, ["~> 1.2.3"])
56
+ s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
57
+ s.add_dependency(%q<simplecov>, [">= 0"])
58
+ end
59
+ else
60
+ s.add_dependency(%q<shoulda>, [">= 0"])
61
+ s.add_dependency(%q<rdoc>, ["~> 3.12"])
62
+ s.add_dependency(%q<bundler>, ["~> 1.2.3"])
63
+ s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
64
+ s.add_dependency(%q<simplecov>, [">= 0"])
65
+ end
66
+ end
67
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: listable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-29 00:00:00.000000000 Z
12
+ date: 2013-01-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: shoulda
16
- requirement: !ruby/object:Gem::Requirement
16
+ requirement: &2152485300 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,15 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
- requirements:
27
- - - ! '>='
28
- - !ruby/object:Gem::Version
29
- version: '0'
24
+ version_requirements: *2152485300
30
25
  - !ruby/object:Gem::Dependency
31
26
  name: rdoc
32
- requirement: !ruby/object:Gem::Requirement
27
+ requirement: &2152484460 !ruby/object:Gem::Requirement
33
28
  none: false
34
29
  requirements:
35
30
  - - ~>
@@ -37,15 +32,10 @@ dependencies:
37
32
  version: '3.12'
38
33
  type: :development
39
34
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
- requirements:
43
- - - ~>
44
- - !ruby/object:Gem::Version
45
- version: '3.12'
35
+ version_requirements: *2152484460
46
36
  - !ruby/object:Gem::Dependency
47
37
  name: bundler
48
- requirement: !ruby/object:Gem::Requirement
38
+ requirement: &2152483720 !ruby/object:Gem::Requirement
49
39
  none: false
50
40
  requirements:
51
41
  - - ~>
@@ -53,15 +43,10 @@ dependencies:
53
43
  version: 1.2.3
54
44
  type: :development
55
45
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ~>
60
- - !ruby/object:Gem::Version
61
- version: 1.2.3
46
+ version_requirements: *2152483720
62
47
  - !ruby/object:Gem::Dependency
63
48
  name: jeweler
64
- requirement: !ruby/object:Gem::Requirement
49
+ requirement: &2152482700 !ruby/object:Gem::Requirement
65
50
  none: false
66
51
  requirements:
67
52
  - - ~>
@@ -69,15 +54,10 @@ dependencies:
69
54
  version: 1.8.4
70
55
  type: :development
71
56
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ~>
76
- - !ruby/object:Gem::Version
77
- version: 1.8.4
57
+ version_requirements: *2152482700
78
58
  - !ruby/object:Gem::Dependency
79
59
  name: simplecov
80
- requirement: !ruby/object:Gem::Requirement
60
+ requirement: &2152481140 !ruby/object:Gem::Requirement
81
61
  none: false
82
62
  requirements:
83
63
  - - ! '>='
@@ -85,12 +65,7 @@ dependencies:
85
65
  version: '0'
86
66
  type: :development
87
67
  prerelease: false
88
- version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
- requirements:
91
- - - ! '>='
92
- - !ruby/object:Gem::Version
93
- version: '0'
68
+ version_requirements: *2152481140
94
69
  description: ! "With listable you can consolidate fields from several models into
95
70
  one, backed up by a database view.\n It is perfect for e.g.
96
71
  a front page where you may want to display the most recent additions to your site
@@ -117,6 +92,7 @@ files:
117
92
  - lib/listable/railtie.rb
118
93
  - lib/listable/view_manager.rb
119
94
  - lib/tasks/listable.rake
95
+ - listable.gemspec
120
96
  - test/helper.rb
121
97
  - test/test_listable.rb
122
98
  homepage: http://github.com/baldursson/listable
@@ -134,7 +110,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
134
110
  version: '0'
135
111
  segments:
136
112
  - 0
137
- hash: -3454069564760365007
113
+ hash: 391745619367195881
138
114
  required_rubygems_version: !ruby/object:Gem::Requirement
139
115
  none: false
140
116
  requirements:
@@ -143,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
119
  version: '0'
144
120
  requirements: []
145
121
  rubyforge_project:
146
- rubygems_version: 1.8.19
122
+ rubygems_version: 1.8.10
147
123
  signing_key:
148
124
  specification_version: 3
149
125
  summary: Rails extension that makes it easy to list and query several models through