set_as_primary 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 06f7d231ec1dc1effe46cd6b516c12bcffdf98b3feadde4d0f0a5b8e193f2047
4
- data.tar.gz: 6f21389fa3d8aa3c8a2bc512dfb26874b84c9b3cfd060afc3b9c7ba18cac9781
3
+ metadata.gz: 7b410c90868639a2814d0d217615e4aab6629ecfd95b8d4c2807682f441196b1
4
+ data.tar.gz: c23232116cbd213ab9e89efe63a2b4952fc27e2948bac8173309913414d9443b
5
5
  SHA512:
6
- metadata.gz: 625e12dd80c2c13f78d5d557504db3cfbce52124846c64d735ed71a16f4f0feb1b41f69a8da8a3c20e58ecc29e3ebff5fdd0cb229dc9c1f78495fb6ff46b56fc
7
- data.tar.gz: b706248616ceacf293a0b0ff8c9769226ae5e088c026cc655b3937159c5606132b8bb37665e425bac213c2c95e93da43a8132631e50822f94a19f8d6a4030446
6
+ metadata.gz: 0d63e1a3a0a41c023e23ab5153a1cfd6f58ad3457fe3e6ca48c51245c958ec96d2b62fd04e1af27355cd0e42e37685245c2c09f40fae65e35c8e239f8ac2d412
7
+ data.tar.gz: ad973cfdab0ac3dded4f7bf1b33fa5e5df8942a494a4c7d0b22f36edff253d20c764e2c762d28c355e8bb972091655d69dfd4b1de99cbc76372e42e8674d9e14
@@ -1,9 +1,11 @@
1
+ ## 0.1.3 (2019-02-02)
2
+ - Fixed index_on issue.
3
+
1
4
  ## 0.1.2 (2019-02-02)
2
5
  - Supported unique partial index.
3
6
  - Changed generator definition. Now it also accepts `flag_name`, `owner_key`.
4
7
  - Handled `force_primary` in `after_create` callback.
5
8
  - Refactored the code.
6
-
7
9
  ## 0.1.1 (2019-12-29)
8
10
 
9
11
  - Added support for single model with no association.
data/README.md CHANGED
@@ -121,7 +121,7 @@ class AddPrimaryColumnToEmailAddresses < ActiveRecord::Migration[6.0]
121
121
  def change
122
122
  add_column :email_addresses, :primary, :boolean, default: false, null: false
123
123
  # NOTE: Please uncomment following line if you want only one 'true' (constraint) in the table.
124
- # add_index :email_addresses, %i[user_id, primary], unique: true, where: "(email_addresses.primary IS TRUE)"
124
+ # add_index :email_addresses, %i[user_id primary], unique: true, where: "(email_addresses.primary IS TRUE)"
125
125
  end
126
126
  end
127
127
  ```
@@ -38,9 +38,9 @@ module SetAsPrimary
38
38
 
39
39
  if owner_association.options[:polymorphic]
40
40
  owner_type_key = "#{owner_key}_type"
41
- "%i[#{owner_id_key}, #{owner_type_key}, #{flag_name}]"
41
+ "%i[#{owner_id_key} #{owner_type_key} #{flag_name}]"
42
42
  else
43
- "%i[#{owner_id_key}, #{flag_name}]"
43
+ "%i[#{owner_id_key} #{flag_name}]"
44
44
  end
45
45
  else
46
46
  ":#{flag_name}"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SetAsPrimary
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: set_as_primary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Santosh Wadghule