dorp 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +79 -0
  3. data/Rakefile +16 -0
  4. metadata +77 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 45cc6ea3aa0db3c8b88071f5bbc0a379e0c536e96d55adc585f13704db957b08
4
+ data.tar.gz: 5aab5f7f95e9e40209d95ce66e8f040fb33149c10e56a9a518fbc6b488f5c61e
5
+ SHA512:
6
+ metadata.gz: 1e26d8912244e1667603246cc83ad090f38f900bda317a4cddda4c4d00571f78637e22b4dae5b60af0b22c4c4dd8a232c12c2451d8f082a6ccba71c8f44bebb8
7
+ data.tar.gz: e03b51674383d1c115e9216526e7606ae736f74f8a3a771c6ec718e798ced509ab4f47213734af95828baf9e2b1e923abb48c2c74237b2d9e9d2d337e8c77b14
data/README.md ADDED
@@ -0,0 +1,79 @@
1
+ # Dorp
2
+ The term "Dorp" is the word in Dutch/Afrikaans that mean 'village', symbolizing the gem's capacity for managing multiple distinct 'tenants' in a single application.
3
+
4
+ Key Features:
5
+ - Supports the essential CRUD operations for multi-tenant data isolation
6
+ - Middleware support for subdomain or domain-based tenant scoping
7
+ - Compatibility with Ruby on Rails 6.1+
8
+
9
+ The goal of the gem is to leverage to the maximum rails multi db feature.
10
+
11
+ ## Installation
12
+
13
+ To install the Dorp gem, add this line to your project's Gemfile:
14
+
15
+ ```ruby
16
+ gem 'dorp'
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ### Configuration
22
+
23
+ To start, you need to cha
24
+
25
+ To migrate the the the database yaml from from a single database to multiple databases, you can use the following command:
26
+
27
+ Before:
28
+ ```yaml
29
+ development:
30
+ adapter: postgresql
31
+ database: myapp_development
32
+ ....
33
+ ```
34
+
35
+ After:
36
+ ```yaml
37
+ development:
38
+ main:
39
+ adapter: postgresql
40
+ database: myapp_development
41
+ primary: true
42
+ ....
43
+
44
+ hamlets:
45
+ adapter: postgresql
46
+ database: myapp_tenants_development
47
+ migrations_paths: db/tenants_migrate ## Those are the migrations that will be run for each tenant
48
+ ```
49
+
50
+ ### Creating a new tenant
51
+
52
+ To create a new tenant, you can use the following command:
53
+
54
+ ```ruby
55
+ Dorp::Tenant.create(name: 'my_tenant', subdomain: 'my_tenant')
56
+ ```
57
+
58
+ ### Creating a new model
59
+
60
+ Before starting, an abstract model must be created. This model will be used as a base for all the models that will be created for each tenant.
61
+
62
+ ```ruby
63
+ class TenantRecord < ApplicationRecord
64
+ self.abstract_class = true
65
+ include Dorp::TenantRecord
66
+ end
67
+ ```
68
+
69
+ Then, you can create a new model that will be used for each tenant:
70
+
71
+ ```ruby
72
+
73
+ ## Contributing
74
+
75
+ Bug reports and pull requests are welcome on GitHub at https://github.com/seuros/dorp.
76
+
77
+ ## License
78
+
79
+ 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,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+
5
+ APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
6
+ load 'rails/tasks/engine.rake'
7
+
8
+ load 'rails/tasks/statistics.rake'
9
+
10
+ require 'bundler/gem_tasks'
11
+
12
+ require 'rubocop/rake_task'
13
+
14
+ RuboCop::RakeTask.new
15
+
16
+ task default: %i[test rubocop]
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dorp
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Abdelkader Boudih
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-02-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: activerecord
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 6.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 6.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: railties
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 6.1.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 6.1.0
41
+ description: ActiveRecord Multi-tenant
42
+ email:
43
+ - terminale@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - README.md
49
+ - Rakefile
50
+ homepage: https://github.com/seuros/dorp
51
+ licenses:
52
+ - MIT
53
+ metadata:
54
+ homepage_uri: https://github.com/seuros/dorp
55
+ source_code_uri: https://github.com/seuros/dorp
56
+ changelog_uri: https://github.com/seuros/dorp/blob/master/CHANGELOG.md
57
+ rubygems_mfa_required: 'true'
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 3.1.0
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubygems_version: 3.3.26
74
+ signing_key:
75
+ specification_version: 4
76
+ summary: ActiveRecord Multi-tenant
77
+ test_files: []