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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb39a285f6315478ee14e0bdaab4745e464db519
4
- data.tar.gz: 9f14109056c0a056ae3781a1966b47cd3df19b5f
3
+ metadata.gz: 736273988a8fa45f51be7a43b9672a70a25d9ddd
4
+ data.tar.gz: f27a518bc045aa5573a1591e553348446d0c28c9
5
5
  SHA512:
6
- metadata.gz: a4a34b0ac25cef02b5c73f76f7aa7b927473b754bac6e19da2940d8a4c22cef522d0002dda3e05f7536450d003fb44d4597609583e13ebcec8d436a02e9f0cde
7
- data.tar.gz: 29d1a16de2f085a4f4f5cdc45b3521409ecdb65469c7397efc9c76b65c0b857ca41fab019916390e620b19f3c9a9ec46e87837a43eb7aef36b7c91c681acf907
6
+ metadata.gz: 0e25ded29d90b07a38ff43525c558ecc3462d78e813c4d844430c1d463407a2fbc86e9cb455928f5a2b05facfb582779676e37e53ec3d98e4f9134405fd5c665
7
+ data.tar.gz: 04926aad616c3aa0b70daf50381267bc9d3f1f2d586e34fb455d51377843d099c97dc32bd019984ef46896fcbd575460a0cac6a91804f6c5d718a9699460ff46
@@ -11,6 +11,7 @@ ActionController::Base.class_eval do
11
11
  end
12
12
  end
13
13
  end
14
+
14
15
  end
15
16
 
16
17
 
@@ -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(domain_id: SiteFramework::CurrentState.instance.domain)
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 :domain_id
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.info("Domain name '#{request.host}' does not match with any exist domains")
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
@@ -1,3 +1,3 @@
1
1
  module SiteFramework
2
- VERSION = '4.1.2'
2
+ VERSION = '4.2.0'
3
3
  end
@@ -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, 'site_framework/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.1.2
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-24 00:00:00.000000000 Z
11
+ date: 2016-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties