trusty-multi-site-extension 1.1.4 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTU4NmI1YTRkOTg2NTMzODdjMzc1ZWNlODk0ODE2ZjViNGFhYmVjOQ==
4
+ YTBjODNjMTEzN2UwNzBiZTRlMTM1N2ViZWQ5NTU5OGU1NWE2N2I0Mw==
5
5
  data.tar.gz: !binary |-
6
- NjNhMmM3NmFjNDI0ODRiMTc4YjU2NTM1Mzg2MTU2N2M1MDk4MjcyNg==
6
+ YTBjNGQ0YmJlM2ZjY2E5Y2VhYzViOTdhM2M3OWEwODYwZjk0NmNhMA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjEzN2QyYjQ3NTkzZDAxNTRmNTg1ZTk0ODMzNmQyNDlmMjcwOTQ2NTU1ZmQx
10
- Y2ZhNTFmYzBiNmM1YzI4NDE5MGYzYzI0NGQ5YjBmZmRlMTBiNzMzYTlmMzhj
11
- NmY0OTM0ZWNkNDIwYTMyMDY2MDY0YTE2OWYxMWRjZGM0YmJjYmI=
9
+ MjA3NzRhZTI0OWVlZWFiZTNhYjJiYmMxYjNmOTA5NDMwMDJlNjcxNTI2YTc1
10
+ ZGI1ZDRhNjE3YzU3N2ViYTMwNjA2NDE1MTEyZGYyNGNhODliNGNjMDJjNWVm
11
+ OGNjMTcwYzhjM2QwNGEwNTY5Y2RiOGI2YTcyOGQ2M2JhZTIyYjc=
12
12
  data.tar.gz: !binary |-
13
- NzAxN2IwYjg0ODdlMTVmNTUxN2JhOTU3NDUzNjg1ZTA5OTQ1YjdmN2QwYWMw
14
- NzVmNDA5ZDQ1NGMxMjBhNWVlMDdjOTY0ODczYTgwNGMwMjYwZWFmNDU1ZDgy
15
- Y2MwOTY5MDQ0MjY0M2ZlMDIyNTJlY2EzNjQ5MjIxYzg0YTI0OTc=
13
+ MWI4Mzc3OTdhM2NlYmRhNWZiZTAxYTlhNjA2NWFjNzNkMjM2NDgyMTVhMzU5
14
+ YzQ0YTYyZDk5MjlhNGM3N2JmODJjY2JkYzM2Y2Y4YzU0ZDIyNzljYWFjODE4
15
+ NTA5ZDhiNWQ2NWUyNjc0OTA1ZTMzYmIzNjA1N2E0MTIzNzcyYzI=
@@ -3,6 +3,7 @@
3
3
  module MultiSite::PageExtensions
4
4
  def self.included(base)
5
5
  base.class_eval {
6
+ include InstanceMethods
6
7
  alias_method_chain :url, :sites
7
8
  mattr_accessor :current_site
8
9
  belongs_to :site
@@ -11,10 +12,6 @@ module MultiSite::PageExtensions
11
12
  base.extend ClassMethods
12
13
  class << base
13
14
 
14
- def associate_with_site
15
- self.site_id = Page.current_site.site_id if self.site_id.nil?
16
- end
17
-
18
15
  def find_by_path(path, live=true)
19
16
  root = homepage
20
17
  raise Page::MissingRootPageError unless root
@@ -28,6 +25,12 @@ module MultiSite::PageExtensions
28
25
  end
29
26
  end
30
27
  end
28
+
29
+ module InstanceMethods
30
+ def associate_with_site
31
+ self.site_id = self.parent.site.id if self.site_id.nil?
32
+ end
33
+ end
31
34
 
32
35
  module ClassMethods
33
36
 
@@ -4,7 +4,7 @@ require "trusty-multi-site-extension"
4
4
 
5
5
  Gem::Specification.new do |s|
6
6
  s.name = "trusty-multi-site-extension"
7
- s.version = "1.1.4"
7
+ s.version = "1.1.5"
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.authors = ["Eric Sipple"]
10
10
  s.date = %q{2014-10-07}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trusty-multi-site-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Sipple