superstore 1.0.11 → 1.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e540e117a43369a7a1776533365a423982b5ad61
4
- data.tar.gz: 903bc8a9def4a329f9e9ee054101e69364a9f3e1
3
+ metadata.gz: 2dbdeea44891e8279235f3499ffc43f2613024ca
4
+ data.tar.gz: 23d8acb6c14a91297b758df73ea54557d8ff353d
5
5
  SHA512:
6
- metadata.gz: 5c1b861cc83c89c001983c526de0b188d4b0ef5545039bd27dfdaedcdc73749170abb75999a1f984ea2879c76c4afffabfc4e83feee5b20dd6efc595fcf65c92
7
- data.tar.gz: 9ee34533c2261152b867b13f89d49254f1eb36de5c2a496117589c8dec713089deee9fcd04f0cd7ad0eb51fb7c6d8bc328e031a164046447dc6cfcd97e29796f
6
+ metadata.gz: 74c765f45c487870d43f97e6ffcf361a81c7e783476c2ad57d8764ce7e9abf54a11577a017e954272ac8900c019ce6e809bc8a750c87da445ce8c72bf48dd61c
7
+ data.tar.gz: e35465eeb0a7651c39e419789cee64e30872e27c8675a110b000b80bcf68f562dc08cafc3c9c1ab149e238b8c9607c325fe78410987b61b244ca136251d158e8
@@ -67,7 +67,7 @@ module Superstore
67
67
 
68
68
  def execute(statement)
69
69
  ActiveSupport::Notifications.instrument("cql.cassandra_object", cql: statement) do
70
- connection.exec_query statement
70
+ connection.execute statement
71
71
  end
72
72
  end
73
73
 
@@ -4,11 +4,7 @@ module Superstore
4
4
  include ActiveModel::AttributeMethods
5
5
 
6
6
  included do
7
- if ActiveModel::VERSION::STRING < '3.2'
8
- attribute_method_suffix("", "=")
9
- else
10
- attribute_method_suffix("=")
11
- end
7
+ attribute_method_suffix("=")
12
8
 
13
9
  # (Alias for the protected read_attribute method).
14
10
  def [](attr_name)
@@ -66,12 +62,10 @@ module Superstore
66
62
  end
67
63
 
68
64
  def method_missing(method_id, *args, &block)
69
- if !self.class.attribute_methods_generated?
70
- self.class.define_attribute_methods
71
- send(method_id, *args, &block)
72
- else
73
- super
74
- end
65
+ self.class.define_attribute_methods unless self.class.attribute_methods_generated?
66
+
67
+ match = match_attribute_method?(method_id.to_s)
68
+ match ? attribute_missing(match, *args, &block) : super
75
69
  end
76
70
 
77
71
  def respond_to?(*args)
data/superstore.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'superstore'
5
- s.version = '1.0.11'
5
+ s.version = '1.0.12'
6
6
  s.description = 'ActiveModel for many attributes'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
  s.authors = ["Michael Koziarski", "gotime"]
@@ -42,6 +42,15 @@ class Superstore::AttributeMethodsTest < Superstore::TestCase
42
42
  assert_equal 'hey lol', issue.title
43
43
  end
44
44
 
45
+ class ReservedWord < Superstore::Base
46
+ string :system
47
+ end
48
+
49
+ test 'reserved words' do
50
+ r = ReservedWord.new(system: 'hello')
51
+ assert_equal 'hello', r.system
52
+ end
53
+
45
54
  # test 'attribute_exists' do
46
55
  # assert !Issue.new.attribute_exists?(:description)
47
56
  # assert Issue.new(description: nil).attribute_exists?(:description)
@@ -21,7 +21,7 @@ class Superstore::Types::JsonTypeTest < Superstore::Types::TestCase
21
21
 
22
22
  test 'typecast' do
23
23
  assert_equal({'enabled' => false}, coder.typecast('enabled' => false))
24
- assert_equal({'born_at' => "2004-12-24T00:00:00Z"}, coder.typecast('born_at' => Time.utc(2004, 12, 24)))
25
- assert_equal(["2004-12-24T00:00:00Z"], coder.typecast([Time.utc(2004, 12, 24)]))
24
+ assert_equal({'born_at' => "2004-12-24T00:00:00.000Z"}, coder.typecast('born_at' => Time.utc(2004, 12, 24)))
25
+ assert_equal(["2004-12-24T00:00:00.000Z"], coder.typecast([Time.utc(2004, 12, 24)]))
26
26
  end
27
27
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.11
4
+ version: 1.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Koziarski
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-30 00:00:00.000000000 Z
12
+ date: 2014-08-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel