site_framework 4.1.0 → 4.1.2

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: 154edfb2dab5c5bb42f28dc9f7a9093e50354120
4
- data.tar.gz: 76b660d2ca27b37a5672291090dcbc483d2b33ff
3
+ metadata.gz: cb39a285f6315478ee14e0bdaab4745e464db519
4
+ data.tar.gz: 9f14109056c0a056ae3781a1966b47cd3df19b5f
5
5
  SHA512:
6
- metadata.gz: 64dc5b007c5e48fc333f09046ad816f4338f0abe2fd52358d4346f31ca7a4dacc34287ea265259d6dc4b3b7a15c74400b0207c510233c8b848b34d61df9f3e1f
7
- data.tar.gz: d325071a5bf298f9682a6789519e7f373196f3a3507bd135b9cfec30523df9a4763446ce69f6756ee7e44713924430a1bed3da86e3513afa5d1fdbee08dec6b5
6
+ metadata.gz: a4a34b0ac25cef02b5c73f76f7aa7b927473b754bac6e19da2940d8a4c22cef522d0002dda3e05f7536450d003fb44d4597609583e13ebcec8d436a02e9f0cde
7
+ data.tar.gz: 29d1a16de2f085a4f4f5cdc45b3521409ecdb65469c7397efc9c76b65c0b857ca41fab019916390e620b19f3c9a9ec46e87837a43eb7aef36b7c91c681acf907
@@ -27,7 +27,7 @@ module SiteFramework
27
27
  belongs_to :site
28
28
 
29
29
  # Self relation
30
- belongs_to :parent, class_name: self.class.to_s
30
+ belongs_to :parent, class_name: self.to_s
31
31
  validates_associated :site
32
32
  end
33
33
 
@@ -3,8 +3,10 @@ module SiteFramework
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
- belongs_to :domain
7
- default_scope -> { where(:domain => Rails.application.domain) }
6
+ belongs_to :domain, class_name: '::SiteFramework::Domain'
7
+ default_scope -> {
8
+ where(domain_id: SiteFramework::CurrentState.instance.domain)
9
+ }
8
10
  end
9
11
  end
10
12
  end
@@ -1,7 +1,7 @@
1
1
  class ActiveRecord::Migration
2
2
  def domain_aware(table_name)
3
3
  change_table table_name do |t|
4
- t.belongs_to :domain
4
+ t.integer :domain_id
5
5
  end
6
6
  end
7
7
  end
@@ -1,7 +1,9 @@
1
- # This singleton class act as an temp storage for the
2
- # current site and domain
3
- class SiteFramework::CurrentState
4
- include Singleton
1
+ module SiteFramework
2
+ # This singleton class act as an temp storage for the
3
+ # current site and domain
4
+ class CurrentState
5
+ include Singleton
5
6
 
6
- attr_accessor :site, :domain, :domain_name
7
+ attr_accessor :site, :domain, :domain_name
8
+ end
7
9
  end
@@ -1,3 +1,3 @@
1
1
  module SiteFramework
2
- VERSION = '4.1.0'
2
+ VERSION = '4.1.2'
3
3
  end
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.0
4
+ version: 4.1.2
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-03-06 00:00:00.000000000 Z
11
+ date: 2016-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties