dalliance 0.3.0 → 0.3.1

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: 5792029ac730db3f72a9fd7691dc948d4f32ea6a
4
- data.tar.gz: 60d2898195cceb82558fe0a0ba0401f73db5af27
3
+ metadata.gz: db5d9527ed1b1dcfbfae86c153bb1de4f1a1c53b
4
+ data.tar.gz: f539fefa59ae983528b6a7acce1b5ed68b70b0b4
5
5
  SHA512:
6
- metadata.gz: f196084cca0afd9a4ce249e1c21e3561a66e7359ab9c83ca7b17f527239232f5f9de262a928e215259e8242a30910994e13f3259be88e3d78dcd2a5d128ffbac
7
- data.tar.gz: cbe9c5e6139eabf02b015d120b5fb768439230ef0ea3c98181058a16c8a3c62c8b3b2916b66b295f7bae3dc4e947da230a60dc49f8c2f9c62bd4e5992ce6da35
6
+ metadata.gz: 294f9ddc6c675c2c06ba4cf3d1f484916e07d10449b9bae4eae8d7509bbfcabd2144e4ad8bf1817bba5ab69b36807e8a9fa11f2761d3d0b5f631b1590de32e8a
7
+ data.tar.gz: f4173e1e059088be3ccbc70a24f603f09abe943a758903ad2c6a9d60ff12346e29495d6d511c16d199817556fb6f2e979003cbd13414f38284b5f27018f15b1c
data/Gemfile CHANGED
@@ -4,3 +4,7 @@ source "http://rubygems.org"
4
4
  gemspec
5
5
 
6
6
  gem "appraisal"
7
+
8
+ group :development, :test do
9
+ gem 'byebug'
10
+ end
@@ -8,7 +8,9 @@ en:
8
8
  validation_error: Validation Error
9
9
  processing_error: Processing Error
10
10
  completed: Completed
11
- attributes:
12
- dalliance_status: Status
13
- dalliance_error_hash: Errors
14
- dalliance_duration: Processing Time
11
+ attributes:
12
+ dalliance_status: Status
13
+ dalliance_error_hash: Errors
14
+ dalliance_duration: Processing Time
15
+ dalliance:
16
+ dalliance_status_in: Status
@@ -2,7 +2,7 @@ module Dalliance
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 3
5
- TINY = 0
5
+ TINY = 1
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
data/lib/dalliance.rb CHANGED
@@ -119,7 +119,7 @@ module Dalliance
119
119
 
120
120
  module ClassMethods
121
121
  def dalliance_status_in_load_select_array
122
- state_machine(:dalliance_status).states.map {|state| [state.human_name, state.name] }
122
+ state_machine(:dalliance_status).states.sort_by(&:name).map {|state| [state.human_name, state.name.to_s] }
123
123
  end
124
124
 
125
125
  def dalliance_durations
@@ -16,7 +16,7 @@ module Dalliance
16
16
  end
17
17
 
18
18
  def generate_migration
19
- migration_template 'migration.rb', 'db/migrate/create_dalliance_progress_meters'
19
+ migration_template 'migration.rb', 'db/migrate/create_dalliance_progress_meters.rb'
20
20
  end
21
21
  end
22
- end
22
+ end
@@ -1,4 +1,17 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  RSpec.describe 'Dalliance' do
4
- end
4
+ subject { DallianceModel.create }
5
+
6
+ context "self#dalliance_status_in_load_select_array" do
7
+ it "should return [state, human_name]" do
8
+ expect(DallianceModel.dalliance_status_in_load_select_array).to eq([
9
+ ["pending", :pending],
10
+ ["processing", :processing],
11
+ ["validation error", :validation_error],
12
+ ["processing error", :processing_error],
13
+ ["completed", :completed]
14
+ ])
15
+ end
16
+ end
17
+ end
data/spec/spec_helper.rb CHANGED
@@ -4,6 +4,7 @@ require 'bundler/setup'
4
4
  #Automatically included in a rails app...
5
5
  require 'active_support'
6
6
  require 'state_machine'
7
+ require 'byebug'
7
8
 
8
9
  #Required for testing...
9
10
  require 'delayed_job'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dalliance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Sullivan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-20 00:00:00.000000000 Z
11
+ date: 2015-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord