frozen_record 0.5.1 → 0.6.0

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: 26a9a1c390dd933f20b4425c20251269199654a3
4
- data.tar.gz: 7195ebac23a6b7fb3646c088ea617918ef83f855
3
+ metadata.gz: e3ad807dcab80676636ab54fc06c01f5a20358b9
4
+ data.tar.gz: 252b2ef0891b9b62b62616317f1ef5ac4d378abe
5
5
  SHA512:
6
- metadata.gz: c98fed45f791deeb4bb82e6de4256ac9c13e7de694e832a0247350086d9019bf7309ced3b3f4c082d00d5b811b76a4057ec5c17051d750a088c6d743ac371ac1
7
- data.tar.gz: 8a75d723c77d123c56af95e518301000cc2ee44459fec75f3d111e03d2a67ced5c88c0cbc0759c3b2b81eea189fc5d85ffe3c8b91f7bcb0dbf580e778db1a78f
6
+ metadata.gz: e7d43b151b30c11aba06de403a8eace5f49c970f7e11c7501d85775ecd2bb9fae194f2569f00d291d0db11e75e5a96deee74aeddcb66bd2e1433fa113cae5247
7
+ data.tar.gz: 82e9a979804003d0143c945fa17b71cc7f23614100c95bfa79fa414b7ac7e4ff66091cfbc2f97eec88d3748188efacb291659eed182659c770ed12855e0e1c80
data/.travis.yml CHANGED
@@ -2,7 +2,6 @@ sudo: false
2
2
  before_install:
3
3
  - gem install bundler
4
4
  rvm:
5
- - 1.9.3
6
- - 2.0.0
7
- - 2.1.0
8
- - 2.2.0
5
+ - '2.1'
6
+ - '2.2'
7
+ - '2.3.1'
@@ -6,7 +6,10 @@ module FrozenRecord
6
6
  include ActiveModel::Conversion
7
7
  include ActiveModel::AttributeMethods
8
8
  include ActiveModel::Serializers::JSON
9
- include ActiveModel::Serializers::Xml
9
+
10
+ if defined? ActiveModel::Serializers::Xml
11
+ include ActiveModel::Serializers::Xml
12
+ end
10
13
 
11
14
  FIND_BY_PATTERN = /\Afind_by_(\w+)(!?)/
12
15
  FALSY_VALUES = [false, nil, 0, ''].to_set
@@ -6,7 +6,10 @@ module FrozenRecord
6
6
  :keep_if, :pop, :shift, :delete_at, :compact
7
7
  ].to_set
8
8
 
9
- delegate :first, :last, :length, :collect, :map, :each, :all?, :include?, :to_ary, :to_json, :to_xml, :as_json, to: :to_a
9
+ delegate :first, :last, :length, :collect, :map, :each, :all?, :include?, :to_ary, :to_json, :as_json, to: :to_a
10
+ if defined? ActiveModel::Serializers::Xml
11
+ delegate :to_xml, to: :to_a
12
+ end
10
13
 
11
14
  class WhereChain
12
15
  def initialize(scope)
@@ -1,3 +1,3 @@
1
1
  module FrozenRecord
2
- VERSION = '0.5.1'
2
+ VERSION = '0.6.0'
3
3
  end
data/spec/scope_spec.rb CHANGED
@@ -392,8 +392,9 @@ describe 'querying' do
392
392
  describe '.to_xml' do
393
393
 
394
394
  it 'serialize the results' do
395
- json = Country.all.to_json
396
- expect(json).to be == Country.all.to_a.to_json
395
+ skip('ActiveModel::Serializers::Xml is not defined (Active Model 5+ ?)') unless defined? ActiveModel::Serializers::Xml
396
+ xml = Country.all.to_xml
397
+ expect(xml).to be == Country.all.to_a.to_xml
397
398
  end
398
399
 
399
400
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frozen_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-26 00:00:00.000000000 Z
11
+ date: 2016-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel