statesman 0.8.1 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8e2492b67d3e6a95fa6a91b704073a73834f2044
4
- data.tar.gz: 557ecfbe2b21238c38c12ece93296e0faf5f3869
3
+ metadata.gz: 22c81c0ffbcf71e649de15abe178a5e954a043c2
4
+ data.tar.gz: ed4c1908ff56199b4c159080ae0cc0ff400674c2
5
5
  SHA512:
6
- metadata.gz: 052ef370bf131a2772a3f35644872cb13c29c06d7f5153c175853e94c791ab9095ceabf480fb58b8afb056eab69f268f3e0ce4eb6fc48001ceef7821a58191d9
7
- data.tar.gz: d7d13cc58202b83c95a6ec3fba0faf9e6842c959e6b0d43cf21c783af1aca0c8b6a66c3e51e68d684e9c3439d3b0ece04c6c6090b31d29541cb7392461f20f1a
6
+ metadata.gz: 9c37c29ceb18f26fa34e355bfc61728f641a0364380a4ada7202940a6b09e665bff2a14b57a4238886a0cff49dd1abf5cb3d78ff72d07117f03e60373f6d359a
7
+ data.tar.gz: f272350cc56eba5975a70e10468fa7a4d4a22661b758f7d1118ae15f7c53dcca93e94352137ddd2af412e6f97c837975a792c5d2c9e7eba83acad4320ca92e91
@@ -1,3 +1,8 @@
1
+ ## v0.8.2 19 August 2014
2
+ *Fixes*
3
+
4
+ - Stop generating a default value for the metadata column if using MySQL.
5
+
1
6
  ## v0.8.1 19 August 2014
2
7
  *Fixes*
3
8
 
@@ -27,5 +27,10 @@ module Statesman
27
27
  def table_name
28
28
  klass.demodulize.underscore.pluralize
29
29
  end
30
+
31
+ def mysql?
32
+ ActiveRecord::Base.configurations[Rails.env]
33
+ .try(:[], "adapter").try(:match, /mysql/)
34
+ end
30
35
  end
31
36
  end
@@ -2,7 +2,7 @@ class Create<%= migration_class_name %> < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :<%= table_name %> do |t|
4
4
  t.string :to_state
5
- t.text :metadata, default: "{}"
5
+ t.text :metadata<%= ", default: \"{}\"" unless mysql? %>
6
6
  t.integer :sort_key
7
7
  t.integer :<%= parent_id %>
8
8
  t.timestamps
@@ -1,7 +1,7 @@
1
1
  class AddStatesmanTo<%= migration_class_name %> < ActiveRecord::Migration
2
2
  def change
3
3
  add_column :<%= table_name %>, :to_state, :string
4
- add_column :<%= table_name %>, :metadata, :text, default: "{}"
4
+ add_column :<%= table_name %>, :metadata, :text<%= ", default: \"{}\"" unless mysql? %>
5
5
  add_column :<%= table_name %>, :sort_key, :integer
6
6
  add_column :<%= table_name %>, :<%= parent_id %>, :integer
7
7
  add_column :<%= table_name %>, :created_at, :datetime
@@ -1,3 +1,3 @@
1
1
  module Statesman
2
- VERSION = "0.8.1"
2
+ VERSION = "0.8.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: statesman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Marr
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-19 00:00:00.000000000 Z
12
+ date: 2014-09-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -245,7 +245,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
245
245
  version: '0'
246
246
  requirements: []
247
247
  rubyforge_project:
248
- rubygems_version: 2.0.14
248
+ rubygems_version: 2.4.1
249
249
  signing_key:
250
250
  specification_version: 4
251
251
  summary: A statesmanlike state machine library