active_model_serializers_binary 0.2.0 → 0.3.1
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 +5 -5
- data/.gitignore +10 -8
- data/Gemfile +5 -20
- data/Gemfile.lock +33 -140
- data/MIT-LICENSE +1 -1
- data/Rakefile +2 -31
- data/active_model_serializers_binary.gemspec +2 -17
- data/bin/test +5 -0
- data/lib/active_model_serializers_binary/active_model_serializers_binary.rb +142 -124
- data/lib/active_model_serializers_binary/base_type.rb +1 -1
- data/lib/active_model_serializers_binary/data_types.rb +261 -250
- data/lib/active_model_serializers_binary/railtie.rb +4 -0
- data/lib/active_model_serializers_binary/version.rb +1 -1
- data/test/active_model_serializers_binary_test.rb +3 -3
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/app/assets/stylesheets/application.css +1 -15
- data/test/dummy/app/channels/application_cable/channel.rb +4 -0
- data/test/dummy/app/channels/application_cable/connection.rb +4 -0
- data/test/dummy/app/controllers/application_controller.rb +0 -3
- data/test/dummy/app/jobs/application_job.rb +7 -0
- data/test/dummy/app/mailers/application_mailer.rb +4 -0
- data/test/dummy/app/models/application_record.rb +3 -0
- data/test/dummy/app/models/product.rb +28 -0
- data/test/dummy/app/models/silo.rb +6 -0
- data/test/dummy/app/models/type.rb +7 -0
- data/test/dummy/app/views/layouts/application.html.erb +10 -9
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/rails +3 -3
- data/test/dummy/bin/rake +2 -2
- data/test/dummy/bin/setup +33 -0
- data/test/dummy/config/application.rb +12 -13
- data/test/dummy/config/boot.rb +3 -3
- data/test/dummy/config/cable.yml +10 -0
- data/test/dummy/config/database.yml +3 -3
- data/test/dummy/config/environment.rb +1 -1
- data/test/dummy/config/environments/development.rb +46 -15
- data/test/dummy/config/environments/production.rb +38 -33
- data/test/dummy/config/environments/test.rb +34 -13
- data/test/dummy/config/initializers/content_security_policy.rb +25 -0
- data/test/dummy/config/initializers/filter_parameter_logging.rb +6 -2
- data/test/dummy/config/initializers/inflections.rb +4 -4
- data/test/dummy/config/initializers/permissions_policy.rb +11 -0
- data/test/dummy/config/locales/en.yml +13 -3
- data/test/dummy/config/puma.rb +43 -0
- data/test/dummy/config/routes.rb +3 -53
- data/test/dummy/config/storage.yml +34 -0
- data/test/dummy/config.ru +3 -1
- data/test/dummy/db/migrate/20170830125642_create_silos.rb +10 -0
- data/test/dummy/db/schema.rb +5 -6
- data/test/dummy/lib/test_parser.rb +23 -5
- data/test/dummy/public/404.html +6 -6
- data/test/dummy/public/422.html +6 -6
- data/test/dummy/public/500.html +6 -6
- data/test/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/test/dummy/public/apple-touch-icon.png +0 -0
- data/test/dummy/test/fixtures/silos.yml +9 -0
- data/test/dummy/test/models/silo_test.rb +7 -0
- data/test/test_helper.rb +7 -8
- metadata +52 -72
- data/test/dummy/app/models/producto.rb +0 -47
- data/test/dummy/app/models/tipo.rb +0 -18
- data/test/dummy/db/migrate/20160608024807_create_productos.rb +0 -16
- data/test/dummy/db/migrate/20170817015810_create_tipos.rb +0 -9
@@ -1,47 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: productos
|
4
|
-
#
|
5
|
-
# id :integer not null, primary key
|
6
|
-
# uid :integer
|
7
|
-
# silo :integer
|
8
|
-
# nombre :string(255)
|
9
|
-
# total_acumulado :integer
|
10
|
-
# bits1 :boolean
|
11
|
-
# bits2 :boolean
|
12
|
-
# ffloat :float
|
13
|
-
# variable :string(255)
|
14
|
-
# created_at :datetime
|
15
|
-
# updated_at :datetime
|
16
|
-
#
|
17
|
-
|
18
|
-
class Producto < ActiveRecord::Base
|
19
|
-
include ActiveModel::Serializers::Binary
|
20
|
-
|
21
|
-
int16 :uid
|
22
|
-
int16 :silo
|
23
|
-
char :nombre, count: 1, length: 20
|
24
|
-
int32 :total_acumulado
|
25
|
-
bool :bits1
|
26
|
-
bool :bits2
|
27
|
-
bool :bits3, virtual: true
|
28
|
-
bool :bits4, virtual: true
|
29
|
-
bool :bits5, virtual: true
|
30
|
-
bool :bits6, virtual: true
|
31
|
-
bool :bits7, virtual: true
|
32
|
-
bool :bits8, virtual: true
|
33
|
-
bool :bits9, virtual: true
|
34
|
-
bool :bits10, virtual: true
|
35
|
-
bool :bits11, virtual: true
|
36
|
-
bool :bits12, virtual: true
|
37
|
-
bool :bits13, virtual: true
|
38
|
-
bool :bits14, virtual: true
|
39
|
-
bool :bits15, virtual: true
|
40
|
-
bool :bits16, virtual: true
|
41
|
-
float32 :ffloat
|
42
|
-
char :variable, count: 1, length: 20 do |field, mode|
|
43
|
-
puts (mode.to_s + ': variable block').blue
|
44
|
-
end
|
45
|
-
int32 :test, count: 10, virtual: true # No existe en la DB
|
46
|
-
nest :tipo, coder: Tipo
|
47
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
# == Schema Information
|
2
|
-
#
|
3
|
-
# Table name: tipos
|
4
|
-
#
|
5
|
-
# id :integer not null, primary key
|
6
|
-
# name :string
|
7
|
-
# producto_id :integer
|
8
|
-
# created_at :datetime not null
|
9
|
-
# updated_at :datetime not null
|
10
|
-
#
|
11
|
-
|
12
|
-
class Tipo < ActiveRecord::Base
|
13
|
-
include ActiveModel::Serializers::Binary
|
14
|
-
|
15
|
-
int16 :producto_id
|
16
|
-
char :name, count: 1, length: 20
|
17
|
-
|
18
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class CreateProductos < ActiveRecord::Migration
|
2
|
-
def change
|
3
|
-
create_table :productos do |t|
|
4
|
-
t.integer :uid
|
5
|
-
t.integer :silo
|
6
|
-
t.string :nombre
|
7
|
-
t.integer :total_acumulado
|
8
|
-
t.boolean :bits1
|
9
|
-
t.boolean :bits2
|
10
|
-
t.float :ffloat
|
11
|
-
t.string :variable
|
12
|
-
|
13
|
-
t.timestamps
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|