site_framework 4.1.2 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/site_framework/action_controller/base.rb +1 -0
- data/lib/site_framework/active_record/concerns.rb +14 -1
- data/lib/site_framework/active_record/migration.rb +7 -1
- data/lib/site_framework/routing/default_constraint.rb +1 -1
- data/lib/site_framework/version.rb +1 -1
- data/lib/site_framework.rb +7 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 736273988a8fa45f51be7a43b9672a70a25d9ddd
|
4
|
+
data.tar.gz: f27a518bc045aa5573a1591e553348446d0c28c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e25ded29d90b07a38ff43525c558ecc3462d78e813c4d844430c1d463407a2fbc86e9cb455928f5a2b05facfb582779676e37e53ec3d98e4f9134405fd5c665
|
7
|
+
data.tar.gz: 04926aad616c3aa0b70daf50381267bc9d3f1f2d586e34fb455d51377843d099c97dc32bd019984ef46896fcbd575460a0cac6a91804f6c5d718a9699460ff46
|
@@ -3,9 +3,22 @@ module SiteFramework
|
|
3
3
|
extend ActiveSupport::Concern
|
4
4
|
|
5
5
|
included do
|
6
|
+
puts "Warning: This concern is deprecated and will be removed in next version"
|
7
|
+
puts "Use 'SiteFramework::SiteAware' instead."
|
6
8
|
belongs_to :domain, class_name: '::SiteFramework::Domain'
|
7
9
|
default_scope -> {
|
8
|
-
where(
|
10
|
+
where(site: SiteFramework::CurrentState.instance.site)
|
11
|
+
}
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
module SiteAware
|
16
|
+
extend ActiveSupport::Concern
|
17
|
+
|
18
|
+
included do
|
19
|
+
belongs_to :site, class_name: '::SiteFramework::Site'
|
20
|
+
default_scope -> {
|
21
|
+
where(site: SiteFramework::CurrentState.instance.site)
|
9
22
|
}
|
10
23
|
end
|
11
24
|
end
|
@@ -1,7 +1,13 @@
|
|
1
1
|
class ActiveRecord::Migration
|
2
2
|
def domain_aware(table_name)
|
3
|
+
fail "'domain_aware' deprecated use 'site_aware' instead."
|
4
|
+
end
|
5
|
+
|
6
|
+
def site_aware(table_name)
|
3
7
|
change_table table_name do |t|
|
4
|
-
t.integer :
|
8
|
+
t.integer :site_id
|
5
9
|
end
|
10
|
+
|
11
|
+
add_index table_name, :site_id
|
6
12
|
end
|
7
13
|
end
|
@@ -18,7 +18,7 @@ class SiteFramework::Routing::DefaultConstraint
|
|
18
18
|
true
|
19
19
|
|
20
20
|
else
|
21
|
-
logger.
|
21
|
+
logger.warn("Domain name '#{request.host}' does not match with any exist domains")
|
22
22
|
patch_request(request)
|
23
23
|
false
|
24
24
|
end
|
data/lib/site_framework.rb
CHANGED
@@ -2,14 +2,19 @@ require 'site_framework/helpers'
|
|
2
2
|
|
3
3
|
# Main module of `site_framework` gem
|
4
4
|
module SiteFramework
|
5
|
-
autoload :Middleware,
|
5
|
+
autoload :Middleware , 'site_framework/middleware'
|
6
|
+
autoload :DomainAware, 'site_framework/active_record/concerns'
|
7
|
+
autoload :SiteAware, 'site_framework/active_record/concerns'
|
8
|
+
autoload :CurrentState, 'site_framework/current_state'
|
9
|
+
#autoload :Engine, 'site_framework/engine'
|
10
|
+
|
6
11
|
include SiteFramework::Helpers
|
7
12
|
|
8
13
|
module Routing
|
9
14
|
end
|
10
15
|
end
|
11
16
|
|
12
|
-
require 'site_framework/current_state'
|
17
|
+
#require 'site_framework/current_state'
|
13
18
|
require 'site_framework/engine'
|
14
19
|
require 'site_framework/railtie'
|
15
20
|
require 'site_framework/orm'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: site_framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sameer Rahmani
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|