scopes_for_associations 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +9 -0
- data/README.rdoc +3 -3
- data/gemfiles/active_record-3.0.Gemfile +5 -0
- data/gemfiles/active_record-3.1.Gemfile +5 -0
- data/gemfiles/active_record-3.2.Gemfile +5 -0
- data/lib/scopes_for_associations.rb +2 -0
- data/lib/scopes_for_associations/version.rb +1 -1
- data/scopes_for_associations.gemspec +1 -1
- data/spec/scopes_for_associations_spec.rb +4 -3
- data/spec/spec_helper.rb +0 -1
- data/spec/support/matchers.rb +1 -1
- data/spec/support/models.rb +0 -2
- data/spec/support/schema.rb +1 -2
- metadata +13 -10
- data/.gemtest +0 -0
data/.travis.yml
ADDED
data/README.rdoc
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
-
= Scopes for Associations
|
1
|
+
= Scopes for Associations [![Build Status](https://secure.travis-ci.org/ordinaryzelig/fandango.png?branch=master)](http://travis-ci.org/ordinaryzelig/fandango)
|
2
|
+
|
3
|
+
https://github.com/ordinaryzelig/scopes_for_associations
|
2
4
|
|
3
5
|
== Description
|
4
6
|
|
@@ -66,5 +68,3 @@ The examples here are basically reproductions of the tests.
|
|
66
68
|
== Compatibility
|
67
69
|
|
68
70
|
works with ActiveRecord >=3.0.0
|
69
|
-
|
70
|
-
gem-testers: http://gem-testers.org/gems/scopes_for_associations
|
@@ -5,9 +5,6 @@ describe ScopesForAssociations do
|
|
5
5
|
let(:director) { Director.create! }
|
6
6
|
let(:production_company) { ProductionCompany.create! }
|
7
7
|
let(:movie) { Movie.create!(:director => director, :production_company => production_company) }
|
8
|
-
let(:trailer) { Trailer.create!(:director => director, :production_company => production_company, :movie => movie) }
|
9
|
-
let(:movie_comment) { Comment.create! :commentable_type => 'Movie', :commentable_id => movie.id }
|
10
|
-
let(:trailer_comment) { Comment.create! :commentable_type => 'Trailer', :commentable_id => trailer.id }
|
11
8
|
|
12
9
|
it 'should be included in ActiveRecord::Base' do
|
13
10
|
ActiveRecord::Base.should respond_to(:scopes_for_associations)
|
@@ -49,6 +46,10 @@ describe ScopesForAssociations do
|
|
49
46
|
|
50
47
|
context 'for polymorphic belongs_to associations' do
|
51
48
|
|
49
|
+
let(:trailer) { Trailer.create!(:movie => movie) }
|
50
|
+
let(:movie_comment) { Comment.create! :commentable_type => 'Movie', :commentable_id => movie.id }
|
51
|
+
let(:trailer_comment) { Comment.create! :commentable_type => 'Trailer', :commentable_id => trailer.id }
|
52
|
+
|
52
53
|
it 'should define uesful scopes' do
|
53
54
|
Comment.should define_scopes(
|
54
55
|
:for_commentable_id,
|
data/spec/spec_helper.rb
CHANGED
data/spec/support/matchers.rb
CHANGED
data/spec/support/models.rb
CHANGED
data/spec/support/schema.rb
CHANGED
@@ -10,8 +10,7 @@ ActiveRecord::Schema.define do
|
|
10
10
|
create_table(:directors, :force => true)# { |t| }
|
11
11
|
create_table(:production_companies, :force => true) { |t| }
|
12
12
|
create_table :trailers, :force => true do |t|
|
13
|
-
t.belongs_to :
|
14
|
-
t.belongs_to :production_company
|
13
|
+
t.belongs_to :movie
|
15
14
|
end
|
16
15
|
create_table :comments, :force => true do |t|
|
17
16
|
t.belongs_to :commentable, :polymorphic => true
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scopes_for_associations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jared Ning
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2012-02-09 00:00:00 -06:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -65,19 +65,19 @@ dependencies:
|
|
65
65
|
type: :development
|
66
66
|
version_requirements: *id003
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
|
-
name: sqlite3
|
68
|
+
name: sqlite3
|
69
69
|
prerelease: false
|
70
70
|
requirement: &id004 !ruby/object:Gem::Requirement
|
71
71
|
none: false
|
72
72
|
requirements:
|
73
73
|
- - "="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
hash:
|
75
|
+
hash: 17
|
76
76
|
segments:
|
77
77
|
- 1
|
78
|
-
-
|
78
|
+
- 3
|
79
79
|
- 5
|
80
|
-
version: 1.
|
80
|
+
version: 1.3.5
|
81
81
|
type: :development
|
82
82
|
version_requirements: *id004
|
83
83
|
description: Define very basic, commonly used scopes for ActiveRecord associations. E.g. if a Post model has an author and a category association, scopes will be defined like Post.for(author) or Post.for(category).
|
@@ -90,13 +90,16 @@ extensions: []
|
|
90
90
|
extra_rdoc_files: []
|
91
91
|
|
92
92
|
files:
|
93
|
-
- .gemtest
|
94
93
|
- .gitignore
|
95
94
|
- .rspec
|
96
95
|
- .rvmrc
|
96
|
+
- .travis.yml
|
97
97
|
- Gemfile
|
98
98
|
- README.rdoc
|
99
99
|
- Rakefile
|
100
|
+
- gemfiles/active_record-3.0.Gemfile
|
101
|
+
- gemfiles/active_record-3.1.Gemfile
|
102
|
+
- gemfiles/active_record-3.2.Gemfile
|
100
103
|
- lib/scopes_for_associations.rb
|
101
104
|
- lib/scopes_for_associations/version.rb
|
102
105
|
- scopes_for_associations.gemspec
|
@@ -135,7 +138,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
138
|
requirements: []
|
136
139
|
|
137
140
|
rubyforge_project: scopes-for-associations
|
138
|
-
rubygems_version: 1.
|
141
|
+
rubygems_version: 1.6.1
|
139
142
|
signing_key:
|
140
143
|
specification_version: 3
|
141
144
|
summary: Define very basic, commonly used scopes for ActiveRecord associations
|
data/.gemtest
DELETED
File without changes
|