bullet_train-serializers 1.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d22c35164d6218200ab027c87b438bfd83ea9a0cd91f74a2d4801d8ca84999a6
4
+ data.tar.gz: 347b9fb4cd1e5ffa7f7147e4ab6181c077c058e99394fbc07dfe70fdb415c2c1
5
+ SHA512:
6
+ metadata.gz: 00d9f94cc09d6553c4feacec20b41d141139b88922b57ebdc73aa75664ac4c838fffdc7d29c7c10b006cd4fdf5a5d36bbf24879e3810cb4da4650a8783f48d34
7
+ data.tar.gz: b9a48c985af1ff562304ea76c81540446d9030377cfa0c4d0c7170e494c9022e018c7063671aa52e222e12d19431cdd32e078eba48999e378cf591cba2147087
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2022 Andrew Culver
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # BulletTrain::Serializers
2
+ Short description and motivation.
3
+
4
+ ## Usage
5
+ How to use my plugin.
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem "bullet_train-serializers"
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install bullet_train-serializers
22
+ ```
23
+
24
+ ## Contributing
25
+ Contribution directions go here.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ require "bundler/setup"
2
+
3
+ APP_RAKEFILE = File.expand_path("test/dummy/Rakefile", __dir__)
4
+ load "rails/tasks/engine.rake"
5
+
6
+ load "rails/tasks/statistics.rake"
7
+
8
+ require "bundler/gem_tasks"
@@ -0,0 +1,3 @@
1
+ class Api::V1::ApplicationSerializer
2
+ include JSONAPI::Serializer
3
+ end
@@ -0,0 +1,14 @@
1
+ class Api::V1::InvitationSerializer < Api::V1::ApplicationSerializer
2
+ set_type "invitation"
3
+
4
+ attributes :id,
5
+ :team_id,
6
+ :email,
7
+ :from_membership_id,
8
+ # 🚅 super scaffolding will insert new fields above this line.
9
+ :created_at,
10
+ :updated_at
11
+
12
+ belongs_to :from_membership, serializer: Api::V1::MembershipSerializer
13
+ has_one :membership, serializer: Api::V1::MembershipSerializer
14
+ end
@@ -0,0 +1,21 @@
1
+ class Api::V1::MembershipSerializer < Api::V1::ApplicationSerializer
2
+ set_type "membership"
3
+
4
+ attributes :id,
5
+ :team_id,
6
+ :user_id,
7
+ :invitation_id,
8
+ :user_first_name,
9
+ :user_last_name,
10
+ :user_profile_photo_id,
11
+ :user_email,
12
+ :added_by_id,
13
+ # 🚅 super scaffolding will insert new fields above this line.
14
+ :created_at,
15
+ :updated_at
16
+
17
+ belongs_to :user, serializer: Api::V1::UserSerializer
18
+ belongs_to :team, serializer: Api::V1::TeamSerializer
19
+ belongs_to :invitation, serializer: Api::V1::InvitationSerializer
20
+ belongs_to :added_by, serializer: Api::V1::MembershipSerializer
21
+ end
@@ -0,0 +1,13 @@
1
+ class Api::V1::TeamSerializer < Api::V1::ApplicationSerializer
2
+ set_type "team"
3
+
4
+ attributes :id,
5
+ :name,
6
+ :time_zone,
7
+ :locale,
8
+ # 🚅 super scaffolding will insert new fields above this line.
9
+ :created_at,
10
+ :updated_at
11
+
12
+ has_many :scaffolding_absolutely_abstract_creative_concepts, serializer: Api::V1::Scaffolding::AbsolutelyAbstract::CreativeConceptSerializer
13
+ end
@@ -0,0 +1,19 @@
1
+ class Api::V1::UserSerializer < Api::V1::ApplicationSerializer
2
+ set_type "user"
3
+
4
+ attributes :id,
5
+ :email,
6
+ :first_name,
7
+ :last_name,
8
+ :time_zone,
9
+ :profile_photo_id,
10
+ :former_user,
11
+ :locale,
12
+ :platform_agent_of_id,
13
+ # 🚅 super scaffolding will insert new fields above this line.
14
+ :created_at,
15
+ :updated_at
16
+
17
+ has_many :teams, serializer: Api::V1::TeamSerializer
18
+ has_many :memberships, serializer: Api::V1::MembershipSerializer
19
+ end
data/config/routes.rb ADDED
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,6 @@
1
+ module BulletTrain
2
+ module Serializers
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ module BulletTrain
2
+ module Serializers
3
+ VERSION = "1.0.1"
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ require "bullet_train/serializers/version"
2
+ require "bullet_train/serializers/engine"
3
+
4
+ module BulletTrain
5
+ module Serializers
6
+ # Your code goes here...
7
+ end
8
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :bullet_train_serializers do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,87 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bullet_train-serializers
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Andrew Culver
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-01-31 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 7.0.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 7.0.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: jsonapi-serializer
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ description: Bullet Train Serializers
42
+ email:
43
+ - andrew.culver@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - MIT-LICENSE
49
+ - README.md
50
+ - Rakefile
51
+ - app/assets/config/bullet_train_serializers_manifest.js
52
+ - app/serializers/api/v1/application_serializer.rb
53
+ - app/serializers/api/v1/invitation_serializer.rb
54
+ - app/serializers/api/v1/membership_serializer.rb
55
+ - app/serializers/api/v1/team_serializer.rb
56
+ - app/serializers/api/v1/user_serializer.rb
57
+ - config/routes.rb
58
+ - lib/bullet_train/serializers.rb
59
+ - lib/bullet_train/serializers/engine.rb
60
+ - lib/bullet_train/serializers/version.rb
61
+ - lib/tasks/bullet_train/serializers_tasks.rake
62
+ homepage: https://github.com/bullet-train-co/bullet_train-serializers
63
+ licenses:
64
+ - MIT
65
+ metadata:
66
+ homepage_uri: https://github.com/bullet-train-co/bullet_train-serializers
67
+ source_code_uri: https://github.com/bullet-train-co/bullet_train-serializers
68
+ post_install_message:
69
+ rdoc_options: []
70
+ require_paths:
71
+ - lib
72
+ required_ruby_version: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - ">="
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ required_rubygems_version: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ requirements: []
83
+ rubygems_version: 3.2.22
84
+ signing_key:
85
+ specification_version: 4
86
+ summary: Bullet Train Serializers
87
+ test_files: []