undo-serializer-active_model 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +7 -0
- data/Appraisals +24 -0
- data/Gemfile +2 -1
- data/README.md +9 -1
- data/VERSION +1 -1
- data/gemfiles/3.0.gemfile +31 -0
- data/gemfiles/3.1.gemfile +31 -0
- data/gemfiles/3.2.gemfile +31 -0
- data/gemfiles/4.0.gemfile +31 -0
- data/gemfiles/4.1.gemfile +31 -0
- data/lib/undo/serializer/active_model.rb +31 -19
- data/spec/{spec_helper_lite.rb → spec_helper.rb} +1 -1
- data/spec/support/active_record.rb +16 -0
- data/spec/{rails_app/app/models → support/active_record}/role.rb +0 -0
- data/spec/{rails_app/db → support/active_record}/schema.rb +7 -0
- data/spec/{rails_app/app/models → support/active_record}/user.rb +0 -0
- data/spec/{rails_app/app/models → support/active_record}/user_serializer.rb +1 -1
- data/spec/{coverage_helper.rb → support/ci_helper.rb} +2 -0
- data/spec/{factories.rb → support/factories.rb} +2 -0
- data/spec/undo/serializer/active_model_integration_spec.rb +10 -3
- data/spec/undo/serializer/active_model_spec.rb +1 -1
- metadata +23 -47
- data/spec/rails_app/.gitignore +0 -4
- data/spec/rails_app/Rakefile +0 -7
- data/spec/rails_app/app/models/.gitkeep +0 -0
- data/spec/rails_app/config.ru +0 -4
- data/spec/rails_app/config/application.rb +0 -13
- data/spec/rails_app/config/boot.rb +0 -6
- data/spec/rails_app/config/database.yml +0 -7
- data/spec/rails_app/config/environment.rb +0 -5
- data/spec/rails_app/config/environments/development.rb +0 -34
- data/spec/rails_app/config/environments/test.rb +0 -34
- data/spec/rails_app/config/routes.rb +0 -2
- data/spec/rails_app/db/migrate/20140214213610_create_users.rb +0 -10
- data/spec/rails_app/db/migrate/20140214213614_create_roles.rb +0 -10
- data/spec/rails_app/db/seeds.rb +0 -7
- data/spec/rails_app/script/rails +0 -6
- data/spec/spec_helper_rails.rb +0 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8f6129e916df1177c739956b56adcfb3b1f337b
|
|
4
|
+
data.tar.gz: 09f23cd4001f82babd417949d40dced4323e359e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4d219d7d0189d6eeb4bd05bc144e663c543aaeb902d1832545e7b0b4003a353a7514a24cf5d9fdc7417f39dfc57675bc68ea320d6cadf073c89373ccc4c7c034
|
|
7
|
+
data.tar.gz: afda0a79e726b1656deaed0c48d73f6f6052d5414560c91d21a2f9804e20d7d574afa44c3b737bbfa6f7ea7fbba944bd6df5d3c4f8bea346db63bc1b24224e03
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
data/Appraisals
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
appraise "3.0" do
|
|
2
|
+
gem "activerecord", "~> 3.0.20"
|
|
3
|
+
gem "undo-serializer-active_model", :path => "../"
|
|
4
|
+
end
|
|
5
|
+
|
|
6
|
+
appraise "3.1" do
|
|
7
|
+
gem "activerecord", "~> 3.1.12"
|
|
8
|
+
gem "undo-serializer-active_model", :path => "../"
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
appraise "3.2" do
|
|
12
|
+
gem "activerecord", "~> 3.2.15"
|
|
13
|
+
gem "undo-serializer-active_model", :path => "../"
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
appraise "4.0" do
|
|
17
|
+
gem "activerecord", "~> 4.0.0"
|
|
18
|
+
gem "undo-serializer-active_model", :path => "../"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
appraise "4.1" do
|
|
22
|
+
gem "activerecord", "~> 4.1.0.beta"
|
|
23
|
+
gem "undo-serializer-active_model", :path => "../"
|
|
24
|
+
end
|
data/Gemfile
CHANGED
|
@@ -7,6 +7,7 @@ group :development do
|
|
|
7
7
|
platforms :ruby_19, :ruby_20 do
|
|
8
8
|
gem 'pry-plus'
|
|
9
9
|
end
|
|
10
|
+
gem "appraisal", github: "thoughtbot/appraisal"
|
|
10
11
|
end
|
|
11
12
|
|
|
12
13
|
group :test do
|
|
@@ -15,7 +16,7 @@ end
|
|
|
15
16
|
|
|
16
17
|
group :test, :development do
|
|
17
18
|
gem "rspec", ">= 3.0.0.beta1"
|
|
18
|
-
gem '
|
|
19
|
+
gem 'activerecord', '>= 3.0.0'
|
|
19
20
|
gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
|
|
20
21
|
gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
|
|
21
22
|
gem 'factory_girl'
|
data/README.md
CHANGED
|
@@ -97,7 +97,7 @@ Found a bug or have enhancement request? You are welcome at [Github bugtracker](
|
|
|
97
97
|
|
|
98
98
|
Compatibility
|
|
99
99
|
-------------
|
|
100
|
-
tested with Ruby
|
|
100
|
+
tested with Ruby:
|
|
101
101
|
|
|
102
102
|
* 2.1
|
|
103
103
|
* 2.0
|
|
@@ -107,6 +107,14 @@ tested with Ruby
|
|
|
107
107
|
* jruby-19mode
|
|
108
108
|
* jruby-head
|
|
109
109
|
|
|
110
|
+
and ActiveRecord:
|
|
111
|
+
|
|
112
|
+
* 3.0
|
|
113
|
+
* 3.1
|
|
114
|
+
* 3.2
|
|
115
|
+
* 4.0
|
|
116
|
+
* 4.1
|
|
117
|
+
|
|
110
118
|
See [build history](http://travis-ci.org/#!/AlexParamonov/undo-serializer-active_model/builds)
|
|
111
119
|
|
|
112
120
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.0.
|
|
1
|
+
0.0.4
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rake"
|
|
6
|
+
gem "activerecord", "~> 3.0.20"
|
|
7
|
+
gem "undo-serializer-active_model", :path=>"../"
|
|
8
|
+
|
|
9
|
+
group :development do
|
|
10
|
+
gem "pry"
|
|
11
|
+
gem "appraisal", :github=>"thoughtbot/appraisal"
|
|
12
|
+
|
|
13
|
+
platforms :ruby_19, :ruby_20 do
|
|
14
|
+
gem "pry-plus"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
group :test do
|
|
19
|
+
gem "coveralls", :require=>false
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
group :test, :development do
|
|
23
|
+
gem "rspec", ">= 3.0.0.beta1"
|
|
24
|
+
gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
|
|
25
|
+
gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
|
|
26
|
+
gem "factory_girl"
|
|
27
|
+
gem "faker"
|
|
28
|
+
gem "active_model_serializers", "~> 0.8"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
gemspec :path=>".././"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rake"
|
|
6
|
+
gem "activerecord", "~> 3.1.12"
|
|
7
|
+
gem "undo-serializer-active_model", :path=>"../"
|
|
8
|
+
|
|
9
|
+
group :development do
|
|
10
|
+
gem "pry"
|
|
11
|
+
gem "appraisal", :github=>"thoughtbot/appraisal"
|
|
12
|
+
|
|
13
|
+
platforms :ruby_19, :ruby_20 do
|
|
14
|
+
gem "pry-plus"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
group :test do
|
|
19
|
+
gem "coveralls", :require=>false
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
group :test, :development do
|
|
23
|
+
gem "rspec", ">= 3.0.0.beta1"
|
|
24
|
+
gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
|
|
25
|
+
gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
|
|
26
|
+
gem "factory_girl"
|
|
27
|
+
gem "faker"
|
|
28
|
+
gem "active_model_serializers", "~> 0.8"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
gemspec :path=>".././"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rake"
|
|
6
|
+
gem "activerecord", "~> 3.2.15"
|
|
7
|
+
gem "undo-serializer-active_model", :path=>"../"
|
|
8
|
+
|
|
9
|
+
group :development do
|
|
10
|
+
gem "pry"
|
|
11
|
+
gem "appraisal", :github=>"thoughtbot/appraisal"
|
|
12
|
+
|
|
13
|
+
platforms :ruby_19, :ruby_20 do
|
|
14
|
+
gem "pry-plus"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
group :test do
|
|
19
|
+
gem "coveralls", :require=>false
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
group :test, :development do
|
|
23
|
+
gem "rspec", ">= 3.0.0.beta1"
|
|
24
|
+
gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
|
|
25
|
+
gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
|
|
26
|
+
gem "factory_girl"
|
|
27
|
+
gem "faker"
|
|
28
|
+
gem "active_model_serializers", "~> 0.8"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
gemspec :path=>".././"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rake"
|
|
6
|
+
gem "activerecord", "~> 4.0.0"
|
|
7
|
+
gem "undo-serializer-active_model", :path=>"../"
|
|
8
|
+
|
|
9
|
+
group :development do
|
|
10
|
+
gem "pry"
|
|
11
|
+
gem "appraisal", :github=>"thoughtbot/appraisal"
|
|
12
|
+
|
|
13
|
+
platforms :ruby_19, :ruby_20 do
|
|
14
|
+
gem "pry-plus"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
group :test do
|
|
19
|
+
gem "coveralls", :require=>false
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
group :test, :development do
|
|
23
|
+
gem "rspec", ">= 3.0.0.beta1"
|
|
24
|
+
gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
|
|
25
|
+
gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
|
|
26
|
+
gem "factory_girl"
|
|
27
|
+
gem "faker"
|
|
28
|
+
gem "active_model_serializers", "~> 0.8"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
gemspec :path=>".././"
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# This file was generated by Appraisal
|
|
2
|
+
|
|
3
|
+
source "https://rubygems.org"
|
|
4
|
+
|
|
5
|
+
gem "rake"
|
|
6
|
+
gem "activerecord", "~> 4.1.0.beta"
|
|
7
|
+
gem "undo-serializer-active_model", :path=>"../"
|
|
8
|
+
|
|
9
|
+
group :development do
|
|
10
|
+
gem "pry"
|
|
11
|
+
gem "appraisal", :github=>"thoughtbot/appraisal"
|
|
12
|
+
|
|
13
|
+
platforms :ruby_19, :ruby_20 do
|
|
14
|
+
gem "pry-plus"
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
group :test do
|
|
19
|
+
gem "coveralls", :require=>false
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
group :test, :development do
|
|
23
|
+
gem "rspec", ">= 3.0.0.beta1"
|
|
24
|
+
gem "activerecord-jdbcsqlite3-adapter", :platform=>:jruby
|
|
25
|
+
gem "sqlite3", :platform=>[:ruby, :mswin, :mingw]
|
|
26
|
+
gem "factory_girl"
|
|
27
|
+
gem "faker"
|
|
28
|
+
gem "active_model_serializers", "~> 0.8"
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
gemspec :path=>".././"
|
|
@@ -15,26 +15,25 @@ module Undo
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def deserialize(hash)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
object.send "#{field}=", value # not public_send!
|
|
18
|
+
object_handler, data = hash.first
|
|
19
|
+
return unless data.is_a? Hash
|
|
20
|
+
data.stringify_keys!
|
|
21
|
+
|
|
22
|
+
ActiveRecord::Base.transaction do
|
|
23
|
+
initialize_object(object_handler, data).tap do |object|
|
|
24
|
+
data.each do |field, value|
|
|
25
|
+
next if "id" == field && object.persisted?
|
|
26
|
+
|
|
27
|
+
case field
|
|
28
|
+
when /___(.*)/ then deserialize_association object, $1, value
|
|
29
|
+
else deserialize_field object, field, value
|
|
30
|
+
end
|
|
32
31
|
end
|
|
33
|
-
end
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
object.save!
|
|
34
|
+
end
|
|
37
35
|
end
|
|
36
|
+
|
|
38
37
|
end
|
|
39
38
|
|
|
40
39
|
private
|
|
@@ -44,11 +43,24 @@ module Undo
|
|
|
44
43
|
@serializer ||= serializer_source.call object
|
|
45
44
|
end
|
|
46
45
|
|
|
47
|
-
def deserialize_association(association, values)
|
|
46
|
+
def deserialize_association(object, association, values)
|
|
48
47
|
Array.wrap(values).each do |value|
|
|
49
|
-
deserialize(association
|
|
48
|
+
deserialize object.public_send(association) => value
|
|
50
49
|
end
|
|
51
50
|
end
|
|
51
|
+
|
|
52
|
+
def deserialize_field(object, field, value)
|
|
53
|
+
object.send "#{field}=", value # not public_send!
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def initialize_object(object_handler, data)
|
|
57
|
+
id = data.fetch "id"
|
|
58
|
+
relation = case object_handler
|
|
59
|
+
when String, Symbol then object_handler.to_s.camelize.constantize
|
|
60
|
+
else object_handler end
|
|
61
|
+
|
|
62
|
+
relation.where(id: id).first || relation.new(id: id)
|
|
63
|
+
end
|
|
52
64
|
end
|
|
53
65
|
end
|
|
54
66
|
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require 'active_record'
|
|
2
|
+
$: << File.expand_path('active_record', File.dirname(__FILE__))
|
|
3
|
+
|
|
4
|
+
require_relative 'factories'
|
|
5
|
+
|
|
6
|
+
ActiveRecord::Base.establish_connection(
|
|
7
|
+
adapter: "jruby" == RUBY_ENGINE ? "jdbcsqlite3" : "sqlite3",
|
|
8
|
+
database: ":memory:",
|
|
9
|
+
timeout: 5000
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
require_relative "active_record/schema.rb"
|
|
13
|
+
|
|
14
|
+
RSpec.configure do |config|
|
|
15
|
+
config.include FactoryGirl::Syntax::Methods
|
|
16
|
+
end
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
require "
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
require "support/active_record"
|
|
3
|
+
require "user"
|
|
4
|
+
require "role"
|
|
5
|
+
require "user_serializer"
|
|
2
6
|
|
|
3
7
|
describe Undo::Serializer::ActiveModel do
|
|
4
8
|
subject { described_class }
|
|
@@ -7,7 +11,7 @@ describe Undo::Serializer::ActiveModel do
|
|
|
7
11
|
|
|
8
12
|
it "restores object" do
|
|
9
13
|
hash = serializer.serialize user
|
|
10
|
-
user.
|
|
14
|
+
user.delete
|
|
11
15
|
restored_user = serializer.deserialize hash
|
|
12
16
|
|
|
13
17
|
expect(restored_user).to eq user
|
|
@@ -18,9 +22,12 @@ describe Undo::Serializer::ActiveModel do
|
|
|
18
22
|
it "restores object and associations" do
|
|
19
23
|
roles = create_list :role, 3, user: user
|
|
20
24
|
hash = serializer.serialize user
|
|
21
|
-
user.
|
|
25
|
+
user.delete
|
|
26
|
+
Role.delete_all # HACK for ActiveRecord 3.0
|
|
27
|
+
|
|
22
28
|
restored_user = serializer.deserialize hash
|
|
23
29
|
|
|
30
|
+
restored_user.reload # HACK for ActiveRecord 3.0
|
|
24
31
|
expect(restored_user).to eq user
|
|
25
32
|
expect(restored_user.roles).to eq roles
|
|
26
33
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: undo-serializer-active_model
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Paramonov
|
|
@@ -51,35 +51,26 @@ files:
|
|
|
51
51
|
- ".ruby-gemset"
|
|
52
52
|
- ".ruby-version"
|
|
53
53
|
- ".travis.yml"
|
|
54
|
+
- Appraisals
|
|
54
55
|
- Gemfile
|
|
55
56
|
- LICENSE.txt
|
|
56
57
|
- README.md
|
|
57
58
|
- Rakefile
|
|
58
59
|
- VERSION
|
|
60
|
+
- gemfiles/3.0.gemfile
|
|
61
|
+
- gemfiles/3.1.gemfile
|
|
62
|
+
- gemfiles/3.2.gemfile
|
|
63
|
+
- gemfiles/4.0.gemfile
|
|
64
|
+
- gemfiles/4.1.gemfile
|
|
59
65
|
- lib/undo/serializer/active_model.rb
|
|
60
|
-
- spec/
|
|
61
|
-
- spec/
|
|
62
|
-
- spec/
|
|
63
|
-
- spec/
|
|
64
|
-
- spec/
|
|
65
|
-
- spec/
|
|
66
|
-
- spec/
|
|
67
|
-
- spec/
|
|
68
|
-
- spec/rails_app/config.ru
|
|
69
|
-
- spec/rails_app/config/application.rb
|
|
70
|
-
- spec/rails_app/config/boot.rb
|
|
71
|
-
- spec/rails_app/config/database.yml
|
|
72
|
-
- spec/rails_app/config/environment.rb
|
|
73
|
-
- spec/rails_app/config/environments/development.rb
|
|
74
|
-
- spec/rails_app/config/environments/test.rb
|
|
75
|
-
- spec/rails_app/config/routes.rb
|
|
76
|
-
- spec/rails_app/db/migrate/20140214213610_create_users.rb
|
|
77
|
-
- spec/rails_app/db/migrate/20140214213614_create_roles.rb
|
|
78
|
-
- spec/rails_app/db/schema.rb
|
|
79
|
-
- spec/rails_app/db/seeds.rb
|
|
80
|
-
- spec/rails_app/script/rails
|
|
81
|
-
- spec/spec_helper_lite.rb
|
|
82
|
-
- spec/spec_helper_rails.rb
|
|
66
|
+
- spec/spec_helper.rb
|
|
67
|
+
- spec/support/active_record.rb
|
|
68
|
+
- spec/support/active_record/role.rb
|
|
69
|
+
- spec/support/active_record/schema.rb
|
|
70
|
+
- spec/support/active_record/user.rb
|
|
71
|
+
- spec/support/active_record/user_serializer.rb
|
|
72
|
+
- spec/support/ci_helper.rb
|
|
73
|
+
- spec/support/factories.rb
|
|
83
74
|
- spec/undo/serializer/active_model_integration_spec.rb
|
|
84
75
|
- spec/undo/serializer/active_model_spec.rb
|
|
85
76
|
- undo-serializer-active_model.gemspec
|
|
@@ -108,29 +99,14 @@ signing_key:
|
|
|
108
99
|
specification_version: 4
|
|
109
100
|
summary: ActiveModel serializer for Undo gem.
|
|
110
101
|
test_files:
|
|
111
|
-
- spec/
|
|
112
|
-
- spec/
|
|
113
|
-
- spec/
|
|
114
|
-
- spec/
|
|
115
|
-
- spec/
|
|
116
|
-
- spec/
|
|
117
|
-
- spec/
|
|
118
|
-
- spec/
|
|
119
|
-
- spec/rails_app/config.ru
|
|
120
|
-
- spec/rails_app/config/application.rb
|
|
121
|
-
- spec/rails_app/config/boot.rb
|
|
122
|
-
- spec/rails_app/config/database.yml
|
|
123
|
-
- spec/rails_app/config/environment.rb
|
|
124
|
-
- spec/rails_app/config/environments/development.rb
|
|
125
|
-
- spec/rails_app/config/environments/test.rb
|
|
126
|
-
- spec/rails_app/config/routes.rb
|
|
127
|
-
- spec/rails_app/db/migrate/20140214213610_create_users.rb
|
|
128
|
-
- spec/rails_app/db/migrate/20140214213614_create_roles.rb
|
|
129
|
-
- spec/rails_app/db/schema.rb
|
|
130
|
-
- spec/rails_app/db/seeds.rb
|
|
131
|
-
- spec/rails_app/script/rails
|
|
132
|
-
- spec/spec_helper_lite.rb
|
|
133
|
-
- spec/spec_helper_rails.rb
|
|
102
|
+
- spec/spec_helper.rb
|
|
103
|
+
- spec/support/active_record.rb
|
|
104
|
+
- spec/support/active_record/role.rb
|
|
105
|
+
- spec/support/active_record/schema.rb
|
|
106
|
+
- spec/support/active_record/user.rb
|
|
107
|
+
- spec/support/active_record/user_serializer.rb
|
|
108
|
+
- spec/support/ci_helper.rb
|
|
109
|
+
- spec/support/factories.rb
|
|
134
110
|
- spec/undo/serializer/active_model_integration_spec.rb
|
|
135
111
|
- spec/undo/serializer/active_model_spec.rb
|
|
136
112
|
has_rdoc:
|
data/spec/rails_app/.gitignore
DELETED
data/spec/rails_app/Rakefile
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# Add your own tasks in files placed in lib/tasks ending in .rake,
|
|
2
|
-
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
|
|
3
|
-
|
|
4
|
-
require File.expand_path('../config/application', __FILE__)
|
|
5
|
-
require 'rake'
|
|
6
|
-
|
|
7
|
-
RailsApp::Application.load_tasks
|
|
File without changes
|
data/spec/rails_app/config.ru
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
require File.expand_path('../boot', __FILE__)
|
|
2
|
-
|
|
3
|
-
require "rails/all"
|
|
4
|
-
|
|
5
|
-
# If you have a Gemfile, require the gems listed there, including any gems
|
|
6
|
-
# you've limited to :test, :development, or :production.
|
|
7
|
-
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
|
8
|
-
|
|
9
|
-
module RailsApp
|
|
10
|
-
class Application < Rails::Application
|
|
11
|
-
I18n.enforce_available_locales = false
|
|
12
|
-
end
|
|
13
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
RailsApp::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
-
|
|
4
|
-
# The test environment is used exclusively to run your application's
|
|
5
|
-
# test suite. You never need to work with it otherwise. Remember that
|
|
6
|
-
# your test database is "scratch space" for the test suite and is wiped
|
|
7
|
-
# and recreated between test runs. Don't rely on the data there!
|
|
8
|
-
config.cache_classes = true
|
|
9
|
-
config.eager_load = false
|
|
10
|
-
|
|
11
|
-
# Show full error reports and disable caching
|
|
12
|
-
config.consider_all_requests_local = true
|
|
13
|
-
config.action_controller.perform_caching = false
|
|
14
|
-
|
|
15
|
-
# Raise exceptions instead of rendering exception templates
|
|
16
|
-
config.action_dispatch.show_exceptions = false
|
|
17
|
-
|
|
18
|
-
# Disable request forgery protection in test environment
|
|
19
|
-
config.action_controller.allow_forgery_protection = false
|
|
20
|
-
|
|
21
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
|
22
|
-
# The :test delivery method accumulates sent emails in the
|
|
23
|
-
# ActionMailer::Base.deliveries array.
|
|
24
|
-
config.action_mailer.delivery_method = :test
|
|
25
|
-
config.action_mailer.default_url_options = { :host => 'www.example.com' }
|
|
26
|
-
|
|
27
|
-
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
|
28
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
29
|
-
# like if you have constraints or database-specific column types
|
|
30
|
-
# config.active_record.schema_format = :sql
|
|
31
|
-
|
|
32
|
-
# Print deprecation notices to the stderr
|
|
33
|
-
config.active_support.deprecation = :stderr
|
|
34
|
-
end
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
RailsApp::Application.configure do
|
|
2
|
-
# Settings specified here will take precedence over those in config/application.rb
|
|
3
|
-
|
|
4
|
-
# The test environment is used exclusively to run your application's
|
|
5
|
-
# test suite. You never need to work with it otherwise. Remember that
|
|
6
|
-
# your test database is "scratch space" for the test suite and is wiped
|
|
7
|
-
# and recreated between test runs. Don't rely on the data there!
|
|
8
|
-
config.cache_classes = true
|
|
9
|
-
config.eager_load = false
|
|
10
|
-
|
|
11
|
-
# Show full error reports and disable caching
|
|
12
|
-
config.consider_all_requests_local = true
|
|
13
|
-
config.action_controller.perform_caching = false
|
|
14
|
-
|
|
15
|
-
# Raise exceptions instead of rendering exception templates
|
|
16
|
-
config.action_dispatch.show_exceptions = false
|
|
17
|
-
|
|
18
|
-
# Disable request forgery protection in test environment
|
|
19
|
-
config.action_controller.allow_forgery_protection = false
|
|
20
|
-
|
|
21
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
|
22
|
-
# The :test delivery method accumulates sent emails in the
|
|
23
|
-
# ActionMailer::Base.deliveries array.
|
|
24
|
-
config.action_mailer.delivery_method = :test
|
|
25
|
-
config.action_mailer.default_url_options = { :host => 'www.example.com' }
|
|
26
|
-
|
|
27
|
-
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
|
28
|
-
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
|
29
|
-
# like if you have constraints or database-specific column types
|
|
30
|
-
# config.active_record.schema_format = :sql
|
|
31
|
-
|
|
32
|
-
# Print deprecation notices to the stderr
|
|
33
|
-
config.active_support.deprecation = :stderr
|
|
34
|
-
end
|
data/spec/rails_app/db/seeds.rb
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
# This file should contain all the record creation needed to seed the database with its default values.
|
|
2
|
-
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
|
|
3
|
-
#
|
|
4
|
-
# Examples:
|
|
5
|
-
#
|
|
6
|
-
# cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
|
|
7
|
-
# Mayor.create(:name => 'Daley', :city => cities.first)
|
data/spec/rails_app/script/rails
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
|
3
|
-
|
|
4
|
-
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
|
5
|
-
require File.expand_path('../../config/boot', __FILE__)
|
|
6
|
-
require 'rails/commands'
|
data/spec/spec_helper_rails.rb
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
require_relative 'spec_helper_lite'
|
|
2
|
-
require_relative 'rails_app/config/environment'
|
|
3
|
-
require_relative 'factories'
|
|
4
|
-
|
|
5
|
-
ActiveRecord::Migration.verbose = false
|
|
6
|
-
ActiveRecord::Migrator.migrate(Rails.root.join('db', 'migrate').to_s)
|
|
7
|
-
|
|
8
|
-
RSpec.configure do |config|
|
|
9
|
-
config.include FactoryGirl::Syntax::Methods
|
|
10
|
-
end
|