active_record_model_and_rspec_enhanced_templates 1.0.3 → 1.0.4

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: 7634675e1eaa90f8ef3b85f64b6d2f7fc057b6d3
4
- data.tar.gz: 79f604659c251390f7e55addd9f5edc72c199747
3
+ metadata.gz: 41d8412ad83885b1b8946404d042d23ddc578b57
4
+ data.tar.gz: 00f71cb6c28db4aa4ad158aa1240be2c55626664
5
5
  SHA512:
6
- metadata.gz: 7f129fdfb6df4eb1d1df9a80fa99f2ad709fb0a4e73c79e69a372f08625a2ceb2fcac41ef23378d2b1c74afce677110b2fa317199287048242306196af43fd77
7
- data.tar.gz: 04cbd1666aaff72afaeb4caf3df1fa4bb52a5e8e0f56694a5548fc1dd2c3b02583f01647a0fd91ef9d1592ff3bec32abef2bc848f42dbdc159074f40e8f7ad6b
6
+ metadata.gz: ab687d1c0d118c565075a78ade5905f6eff69d1a210491954c0659dd81175511bd611a2272bf6fbea16e1c80fcb104c530f3a46146f631148416cdd1e4b90e5c
7
+ data.tar.gz: 54468cd71ee710001333606026c153d088744c58eb6f69ba499f357b08431d85cddc376122a533088cdd1ee0c18404862acea10141a9ca1d5d2e3898ab9711ea
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.3
1
+ 1.0.4
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: active_record_model_and_rspec_enhanced_templates 1.0.3 ruby lib
5
+ # stub: active_record_model_and_rspec_enhanced_templates 1.0.4 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "active_record_model_and_rspec_enhanced_templates"
9
- s.version = "1.0.3"
9
+ s.version = "1.0.4"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Dmitri Koulikoff"]
14
- s.date = "2014-10-06"
14
+ s.date = "2014-10-16"
15
15
  s.description = "ActiveRecord generator and RSpec templates that add some basic functionality to the model and its spec"
16
16
  s.email = "dima@koulikoff.ru"
17
17
  s.extra_rdoc_files = [
@@ -7,10 +7,10 @@ class <%= class_name %> < <%= parent_class_name.classify %>
7
7
  <% if attributes.any?(&:password_digest?) -%>
8
8
  has_secure_password
9
9
  <% end -%>
10
- <% attribute = attributes.detect{|a| a.name == 'position'} || attributes.detect{|a| a.name == 'name'} || attributes.detect{|a| a.name == 'title'} || attributes.first -%>
11
- <% if attribute -%>
10
+ <% if attribute = attributes.detect{|a| a.name == 'position'} || attributes.detect{|a| a.name == 'name'} || attributes.detect{|a| a.name == 'title'} || attributes.first -%>
11
+
12
12
  scope :ordered, -> { order(:<%=attribute.name %>) }
13
- <% end -%>
14
13
 
14
+ <% end -%>
15
15
  end
16
16
  <% end -%>
@@ -20,6 +20,7 @@ describe <%= class_name %>, type: :model do
20
20
 
21
21
  it { should be_valid }
22
22
 
23
+ <% if attribute = attributes.detect{|a| a.name == 'position'} || attributes.detect{|a| a.name == 'name'} || attributes.detect{|a| a.name == 'title'} || attributes.first -%>
23
24
  describe :class do
24
25
  it 'should respond to :ordered' do
25
26
  <% if options[:fixture_replacement] == :factory_girl -%>
@@ -29,10 +30,10 @@ describe <%= class_name %>, type: :model do
29
30
  <%= class_name %>.create @valid_attrs
30
31
  <%= class_name %>.create @valid_attrs
31
32
  <% end -%>
32
- <% attribute = attributes.detect{|a| a.name == 'position'} || attributes.detect{|a| a.name == 'name'} || attributes.detect{|a| a.name == 'title'} || attributes.first -%>
33
33
  expect(<%= class_name %>.ordered).to eq <%= class_name %>.order(:<%=attribute.name %>)
34
34
  end
35
35
  end
36
36
 
37
+ <% end -%>
37
38
  end
38
39
  <% end -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_record_model_and_rspec_enhanced_templates
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitri Koulikoff
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-06 00:00:00.000000000 Z
11
+ date: 2014-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec