acts_as_having_string_id 0.2.1 → 0.2.2

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: c7195bb3e8f471af64c175437042f3b35fe514d8
4
- data.tar.gz: be9a9440e976e47f4d8ad03ba69e0244e4a018f0
3
+ metadata.gz: a0af1a565f4bd65e2d7c60cea9c272904e1bade7
4
+ data.tar.gz: 15fa151842983d01af209267b848c6a3d1daa785
5
5
  SHA512:
6
- metadata.gz: fd9fd3d983d888300e527efbe6c0b76828dde967d8069e987ba85ea6734608696e3df392550cbc78ed8ff73ef0ec7ff8e08baa7e07f308efd3d686991c8602da
7
- data.tar.gz: 9152383d4df79590fb76da8e7f3a4b73df8068a086eacf2254cd6a4e51751e453f2fed894911820df097476e32470b9f5505a407099873a97d2fc0e4f33d4071
6
+ metadata.gz: b9dbfb50194f8162e8e81919b1541ea1ece6e553e873c1bfb37600a514d819ea8757ec7d72f8cef30e2beb1e3a8abf80a2b9047a5b8df60fa4c83d711bf27d7c
7
+ data.tar.gz: 69baadb1387223e3ce034d25e8652daa237188d26c2f1311a0504e2a10df21550547575660c87cc1a574123f1b8d6d085c360e0227f5b68fa45c33fb1e42fb38
@@ -1,8 +1,8 @@
1
1
  module ActsAsHavingStringId
2
2
  class Railtie < Rails::Railtie
3
3
  config.to_prepare do
4
- unless ApplicationRecord.included_modules.include?(ActsAsHavingStringId)
5
- ApplicationRecord.include(ActsAsHavingStringId)
4
+ unless ActiveRecord::Base.included_modules.include?(ActsAsHavingStringId)
5
+ ActiveRecord::Base.include(ActsAsHavingStringId)
6
6
  end
7
7
  end
8
8
  end
@@ -19,6 +19,14 @@ module ActsAsHavingStringId
19
19
  "#{int_value}/#{string_value}"
20
20
  end
21
21
 
22
+ def id
23
+ int_value
24
+ end
25
+
26
+ def quoted_id
27
+ int_value
28
+ end
29
+
22
30
  def to_s
23
31
  string_value
24
32
  end
@@ -1,3 +1,3 @@
1
1
  module ActsAsHavingStringId
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
@@ -14,8 +14,10 @@ module ActsAsHavingStringId
14
14
 
15
15
  self.reflections.each_value do |r|
16
16
  # Attribute all foreign keys pointing here as well
17
- r.klass.class_eval do
18
- attribute r.foreign_key.to_sym, attrib_type
17
+ unless r.is_a? ActiveRecord::Reflection::ThroughReflection
18
+ r.klass.class_eval do
19
+ attribute r.foreign_key.to_sym, attrib_type
20
+ end
19
21
  end
20
22
  end
21
23
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_having_string_id
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Magnus Hult
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-08 00:00:00.000000000 Z
11
+ date: 2016-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails