rails_console_toolkit 0.4.0 → 0.5.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: d50673e1deb8963c98f22292c95446f83baa29b18bdb7e06199a80f9e5b1388f
4
- data.tar.gz: 5834816fa5f8fc3136576ad21d6f1d95c9dfb6bbc35cd2210882bb81d18701ce
3
+ metadata.gz: 94b328f9ee8bdc1b7bdb13684838af85b29acb1b63739ff54866639a1b2e808a
4
+ data.tar.gz: 96c5580a3e228f75151c563c9c3eeb1293600e6e8d1fe804d153057dc77411f8
5
5
  SHA512:
6
- metadata.gz: a44ae00ec2915af4452cb40ade632c50142a0661db9fc7b1212189db25740b55ebc3c51df3b4737212d5c8c387ff2f21c703c4940ae793b24fd208085c9c9e89
7
- data.tar.gz: 32f281e091aba5e871699efdf40c744723ba0ef205bb1ece9f7aac2c8e1bb22cc66596a773c714a50135eb53bd3a777fe3ef31a9f2c34b6c210051fc940ec854
6
+ metadata.gz: 51892d46a171bbf751725425b7eef0ca5950412ef3126d19c6f69704dbe88ecafe96053f72086c837606f831c1051464ca969eff6a629fcf795ccd41f95469dd
7
+ data.tar.gz: 89b75d5c465a9ce2e514ba0fcbdea4a2dcda4c299b87a1945a1b1465c49c3697e7f451c2d60866353d620569f0f893b1884d6ded21b5eb5d745ec91a8225bf11
@@ -32,6 +32,7 @@ module RailsConsoleToolkit::Helpers
32
32
 
33
33
  if key
34
34
  record = nil
35
+ record = key if klass === key
35
36
  record ||= klass.find(key) if Numeric === key
36
37
  attribute_names.find { |name| record ||= klass.find_by(name => key) }
37
38
  end
@@ -11,3 +11,6 @@ RailsConsoleToolkit.model_helper Spree::Taxon, as: :taxon, by: [:permalink]
11
11
  RailsConsoleToolkit.model_helper Spree::Order, as: :order, by: [:number]
12
12
  RailsConsoleToolkit.model_helper Spree::User, as: :user, by: [:email]
13
13
  RailsConsoleToolkit.model_helper Spree::Country, as: :country, by: [:iso, :iso3, :iso_name, :name]
14
+ RailsConsoleToolkit.model_helper Spree::Role, as: :role, by: [:name]
15
+ RailsConsoleToolkit.model_helper Spree::Promotion, as: :promotion, by: [:name]
16
+ RailsConsoleToolkit.alias :promo, :promotion
@@ -1,3 +1,3 @@
1
1
  module RailsConsoleToolkit
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_console_toolkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elia Schito
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-10-09 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -111,7 +111,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
111
111
  - !ruby/object:Gem::Version
112
112
  version: '0'
113
113
  requirements: []
114
- rubygems_version: 3.0.3
114
+ rubygems_version: 3.1.2
115
115
  signing_key:
116
116
  specification_version: 4
117
117
  summary: Configurable Rails Console Helpers