uuids 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +2 -2
- data/Rakefile +10 -8
- data/lib/tasks/uuids/install.rake +9 -0
- data/lib/uuids/base/has_uuids.rb +100 -0
- data/lib/uuids/base.rb +10 -47
- data/lib/uuids/version.rb +1 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/development.log +0 -0
- data/spec/dummy/log/test.log +1563 -0
- data/spec/lib/uuids/base_spec.rb +9 -0
- metadata +6 -3
- data/lib/tasks/uuids_tasks.rake +0 -23
data/spec/lib/uuids/base_spec.rb
CHANGED
@@ -49,6 +49,15 @@ module Uuids
|
|
49
49
|
.to [value]
|
50
50
|
end
|
51
51
|
|
52
|
+
it "defines the #uuids= method" do
|
53
|
+
values = [
|
54
|
+
"3ea8fd89-232f-4ed1-90b5-743da173cd7d",
|
55
|
+
"4ea8fd89-232f-4ed1-90b5-743da173cd7d"
|
56
|
+
]
|
57
|
+
expect { subject.uuids = values }
|
58
|
+
.to change { subject.uuids.map(&:value) }.to values
|
59
|
+
end
|
60
|
+
|
52
61
|
it "defines +by_uuid+ class scope" do
|
53
62
|
subject.save!
|
54
63
|
subject.uuids.create!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uuids
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kozin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-10-
|
11
|
+
date: 2014-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -139,9 +139,10 @@ files:
|
|
139
139
|
- config/locales/en.yml
|
140
140
|
- config/locales/ru.yml
|
141
141
|
- db/migrate/20141016112506_create_uuids_uuids.rb
|
142
|
-
- lib/tasks/
|
142
|
+
- lib/tasks/uuids/install.rake
|
143
143
|
- lib/uuids.rb
|
144
144
|
- lib/uuids/base.rb
|
145
|
+
- lib/uuids/base/has_uuids.rb
|
145
146
|
- lib/uuids/engine.rb
|
146
147
|
- lib/uuids/version.rb
|
147
148
|
- spec/dummy/README.rdoc
|
@@ -179,6 +180,7 @@ files:
|
|
179
180
|
- spec/dummy/db/migrate/20141017081115_create_cities.rb
|
180
181
|
- spec/dummy/db/schema.rb
|
181
182
|
- spec/dummy/db/test.sqlite3
|
183
|
+
- spec/dummy/log/development.log
|
182
184
|
- spec/dummy/log/test.log
|
183
185
|
- spec/dummy/public/404.html
|
184
186
|
- spec/dummy/public/422.html
|
@@ -262,6 +264,7 @@ test_files:
|
|
262
264
|
- spec/dummy/Rakefile
|
263
265
|
- spec/dummy/spec/factories/records.rb
|
264
266
|
- spec/dummy/README.rdoc
|
267
|
+
- spec/dummy/log/development.log
|
265
268
|
- spec/dummy/log/test.log
|
266
269
|
- spec/dummy/config.ru
|
267
270
|
- spec/dummy/bin/rake
|
data/lib/tasks/uuids_tasks.rake
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
namespace :uuids do
|
2
|
-
|
3
|
-
def app
|
4
|
-
@app ||= (
|
5
|
-
Rake::Task.task_defined?("railties:install:migrations") ? "" : "app:"
|
6
|
-
)
|
7
|
-
end
|
8
|
-
|
9
|
-
desc "Installs the uuids gem inside a Rails application"
|
10
|
-
task install: %w(environment) do
|
11
|
-
Rake::Task["#{ app }railties:install:migrations"].reenable
|
12
|
-
system "rake #{ app }uuids:install:migrations"
|
13
|
-
system "rake db:migrate SCOPE=uuids RAILS_ENV=#{ Rails.env }"
|
14
|
-
end
|
15
|
-
|
16
|
-
namespace :test do
|
17
|
-
|
18
|
-
desc "Prepares the uuids gem for testing"
|
19
|
-
task :prepare do
|
20
|
-
system "rake db:migrate RAILS_ENV=test"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|