montage_rails 0.4.9 → 0.4.10

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: 06e8cf07d3ec35504bdd050b777d625568eb03ac
4
- data.tar.gz: 0d6213bb3e406a91c34306faeb3141ec8f736e15
3
+ metadata.gz: cb186dd144706726167866ed936c5141b65f6c67
4
+ data.tar.gz: 28a93eb753728e384ed95c1f505e56b15e557a5e
5
5
  SHA512:
6
- metadata.gz: 1efcca92094dc2e5a71bd6fb324c5ac9d7da54ded5c2061b206b98cd66e72a99d23fa9ff99a5425ee4982fc0b2888f4a41576ec38242b197ca85c0c6b04c371b
7
- data.tar.gz: adb21a2db7484ee8e8e4f3fffc8bfb12312f101872afc0b500b6a5fa5db3fc1b2634b035c34db444f9ebd10621e45ca8e27cad01efc3c2f6b9a16d2edd37d219
6
+ metadata.gz: b3500fcf4fcda7d534507932c031859bbec21f6b7ce7e4bfc8b59afab67bf6b60763408c6c9e1387d7d21e1efaa9335c3e16ee3fe5b2c0ed8b721dff5ad2a802
7
+ data.tar.gz: 0d4ce0b65a0b6d9942c2996e44bb70398d2671fd245048f68dc145dc3b1170121198cf61d890a1c14eb2bcaa5c48db917f17db500c60f1347c2be9399cabf893
@@ -27,7 +27,7 @@ module MontageRails
27
27
  # Define a new instance of the query cache
28
28
  #
29
29
  def cache
30
- @cache ||= QueryCache.new
30
+ @cache ||= QueryCache.new(MontageRails.no_caching)
31
31
  end
32
32
 
33
33
  # Hook into the Rails logger
@@ -1,13 +1,15 @@
1
1
  module MontageRails
2
2
  class QueryCache
3
3
  attr_reader :cache
4
+ attr_accessor :no_cache
4
5
 
5
- def initialize
6
+ def initialize(no_cache = false)
6
7
  @cache = {}
8
+ @no_cache = no_cache
7
9
  end
8
10
 
9
11
  def get_or_set_query(klass, query)
10
- cached = cache.keys.include?("#{klass}/#{query}")
12
+ cached = cache.keys.include?("#{klass}/#{query}") && !no_cache
11
13
  ActiveSupport::Notifications.instrument("reql.montage_rails", notification_payload(query, klass, cached)) do
12
14
  if cached
13
15
  cache["#{klass}/#{query}"]
@@ -1,3 +1,3 @@
1
1
  module MontageRails
2
- VERSION = "0.4.9"
2
+ VERSION = "0.4.10"
3
3
  end
data/lib/montage_rails.rb CHANGED
@@ -10,7 +10,7 @@ require 'montage_rails/query_cache'
10
10
 
11
11
  module MontageRails
12
12
  class << self
13
- attr_accessor :username, :password, :token, :domain
13
+ attr_accessor :username, :password, :token, :domain, :no_caching
14
14
 
15
15
  def configure
16
16
  yield self
@@ -1,4 +1,5 @@
1
1
  MontageRails.configure do |c|
2
2
  c.token = "fb761e07-a12b-40bb-a42f-2202ecfd1046"
3
3
  c.domain = "testco"
4
- end
4
+ c.no_caching = true
5
+ end
@@ -1095,3 +1095,10 @@ MontageClient: Checkin connection MontageClient:http://testco.dev.montagehot.clu
1095
1095
  Actor Create (427.4ms) {:movie_id=>"02290fa2-6a62-4910-9074-d97641dceb24", :name=>"Marty McFly"}
1096
1096
  Actor Load [CACHE] (0.0ms) {:filter=>{:movie_id=>"02290fa2-6a62-4910-9074-d97641dceb24"}}
1097
1097
  Actor Load (461.6ms) {:filter=>{:movie_id=>"02290fa2-6a62-4910-9074-d97641dceb24"}}
1098
+ Movie Load (1292.4ms) {:filter=>{}, :limit=>1}
1099
+ Movie Load (344.1ms) {:filter=>{}, :limit=>1}
1100
+ Movie Load [CACHE] (846.4ms) {:filter=>{}, :limit=>1}
1101
+ Movie Load (1595.1ms) {:filter=>{}, :limit=>1}
1102
+ Movie Load [CACHE] (213.7ms) {:filter=>{}, :limit=>1}
1103
+ Movie Load (294.5ms) {:filter=>{}, :limit=>1}
1104
+ Movie Load (248.0ms) {:filter=>{}, :limit=>1}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: montage_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - dphaener
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-18 00:00:00.000000000 Z
11
+ date: 2015-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails