auto_set 1.2.0 → 1.2.1

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: 9e494c395aca1b790701e5546cd7dfcdcd8469ab
4
- data.tar.gz: 5af33c5e296b6819acaa5630001e5c777d949103
3
+ metadata.gz: 3da776d373b205cfcb9664fcc1f71d3364b93180
4
+ data.tar.gz: 44bce8beaa604a02ce868ed23481598765f3bb52
5
5
  SHA512:
6
- metadata.gz: 95c321680ec332d3c902215eaeaed6a3fa8e33ee063e352d8e2aa12879d22b8a77ca7fef3738bb755059d3c0d3d1b9f87e0a11cb1f75e7dad4166dafe7f79486
7
- data.tar.gz: 01dcad5c85909ad2bfbae0f13ceb0b791112ccecd3b28f1af5cf4bba05c2d0447971fa9af17c1f8e693dc3eb39e5101d334c52445f19b70634acc966f67f1e30
6
+ metadata.gz: 10c24f50d104356cf9eee73285087b270986a6f8760f95969ec6effae930eff2d68254f8048daba80bb7de6fc1c3c92565bef9fac5dda40c12ccf5980f42950f
7
+ data.tar.gz: 945f75b2c03228e35c7ae005384e8150246d80aa73162741ce5deba2b208810b6c86ff355933416aefc609aaf21702bd8b5389e056c67b7f298a3b9c5bbdca5c
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 Felipe Diesel
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -56,7 +56,7 @@ module AutoSet
56
56
 
57
57
  def parent_from_column(column, from)
58
58
  if @record.send("#{column}_#{from}").present?
59
- reflection = @record.class.reflections[column.to_s]
59
+ reflection = @record.class.reflections.with_indifferent_access[column]
60
60
  reflection.klass.where(from => @record.send("#{column}_#{from}")).first if reflection.present?
61
61
  end
62
62
  end
@@ -1,3 +1,3 @@
1
1
  module AutoSet
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_set
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felipe Diesel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-26 00:00:00.000000000 Z
11
+ date: 2015-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -177,6 +177,7 @@ files:
177
177
  - .travis.yml
178
178
  - Gemfile
179
179
  - Guardfile
180
+ - LICENSE.txt
180
181
  - README.md
181
182
  - Rakefile
182
183
  - auto_set.gemspec