iry 0.7.1 → 0.8.0

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: 9f4f2307d3e964bffa19be9840122d599cf4d982d6e9b343b86d6e6221f103ab
4
- data.tar.gz: 45b0f1981b5d96720525dc7a79abd081a177fd64e9e00290c0834e43b9fc76fc
3
+ metadata.gz: 9f0f9f174fd7d9539076fe6c50be05824c8055cd3a37cdfbfd8444be73227742
4
+ data.tar.gz: 7be7e62f6e803ba1179e0b074dbdf9f4b9f69fcfde189b291d2aaf9a94dc5a12
5
5
  SHA512:
6
- metadata.gz: 954cdb36ee275f7cb0d9df5eb0a280926d25d68a361f01d9a3d257b77c1ebdd0046193e5fd7b22858c5870cd26c185f387f0252ba5e20431f9506d04b2d38373
7
- data.tar.gz: ea9e598c9c5a3dfd5892f11595cc0cb9993e39ec0b40629a2c2b1a857bbac0dce6feb32e390f861726220bdae385fd41fdb6e261089c5c44a3437f0b7d7bc72a
6
+ metadata.gz: 9f5790093d7a9ff0d5268ed03921817c45927d5e4741c3ccd741e4fcae94f5173deff1454967627e34a61b177420a3989568776bfe962c47654e97a663054590
7
+ data.tar.gz: 44a571a3c63cd105bf3c0f3d8866247c91c064c1b1558a1028dbfca5617e0b210a64d621574c290f98213e7c2ba011cdfc500d2e78e389c9cd43b757a4b419d7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.1
1
+ 0.8.0
data/lib/iry/macros.rb CHANGED
@@ -22,6 +22,7 @@ module Iry
22
22
  raise ArgumentError, "Constraint already exists"
23
23
  end
24
24
 
25
+ self.constraints = constraints.dup
25
26
  constraints[name] = Constraint::Check.new(
26
27
  key,
27
28
  message: message,
@@ -46,6 +47,7 @@ module Iry
46
47
  raise ArgumentError, "Constraint already exists"
47
48
  end
48
49
 
50
+ self.constraints = constraints.dup
49
51
  constraints[name] = Constraint::Exclusion.new(
50
52
  key,
51
53
  message: message,
@@ -75,6 +77,7 @@ module Iry
75
77
  raise ArgumentError, "Constraint already exists"
76
78
  end
77
79
 
80
+ self.constraints = constraints.dup
78
81
  constraints[name] = Constraint::ForeignKey.new(
79
82
  keys,
80
83
  message: message,
@@ -105,6 +108,7 @@ module Iry
105
108
  raise ArgumentError, "Constraint already exists"
106
109
  end
107
110
 
111
+ self.constraints = constraints.dup
108
112
  constraints[name] = Constraint::Unique.new(
109
113
  keys,
110
114
  message: message,
data/lib/iry.rb CHANGED
@@ -81,8 +81,7 @@ module Iry
81
81
  def self.included(klass)
82
82
  klass.class_eval do
83
83
  # From activesupport
84
- class_attribute(:constraints)
85
- self.constraints = {}
84
+ class_attribute(:constraints, default: {})
86
85
  extend(Iry::Macros)
87
86
  include(Iry::Patch)
88
87
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "iry",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "iry",
9
- "version": "0.7.1",
9
+ "version": "0.8.0",
10
10
  "license": "MIT",
11
11
  "devDependencies": {
12
12
  "conventional-changelog-cli": ">= 3.0.0",
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iry",
3
- "version": "0.7.1",
3
+ "version": "0.8.0",
4
4
  "description": "Transform database constraint errors into activerecord validation errors",
5
5
  "private": true,
6
6
  "main": "index.js",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Belladonna