statesman 0.2.0 → 0.2.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: f687db42dd1b0fc5cd988d7ec0ebcab007987a15
4
- data.tar.gz: 659f1fd7fe54809344ef91627df309ea7aa5765b
3
+ metadata.gz: 2ebf6e84cf86743ab926a166de6477906ad46be9
4
+ data.tar.gz: 787d61de37b561637bf53cb16de85c87e272f124
5
5
  SHA512:
6
- metadata.gz: f3f81abd3724a20f36f89c518fcaec9058c65571cd49b297d24ab695e1808f1da5b4e6e92ab52177915d95ba54ae13bc014582c7958085b0ba527c82b96a79fa
7
- data.tar.gz: a437668bf5b79bd9671f0bd0387ac44ceac25f7767c9204ce78a8338fc6d5117d9afb0620d69f569bb20e5025b4962a31290761a5fcebbdad7d82c0ef4f54bed
6
+ metadata.gz: c9641ecdabfeb6df4359887a1de93a81df466965f5a1dd7c2343f23600a9829da270347733b145489d2e4d20befe7c3555e7fc7378a00c52d626681fc5814dae
7
+ data.tar.gz: ae0250320f5c320a295e41200e6ba76cb315810fe0c951de7ec9e7daa8add7fcfff74479db7534fa93ff0f530db3c45d43d55908601724a762fcb98913a8a090
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.2.1, 31 December 2013
2
+ *Fixes*
3
+ - Don't add attr_accessible to generated transition model if running in Rails 4
4
+
1
5
  ## v0.2.0, 16 December 2013
2
6
  *Additions*
3
7
  - Adds Ruby 1.9.3 support (patch by [@jakehow](https://github.com/jakehow))
@@ -36,5 +36,9 @@ module Statesman
36
36
  def parent_id
37
37
  parent.underscore + "_id"
38
38
  end
39
+
40
+ def rails_4?
41
+ Rails.version.split(".").map(&:to_i).first >= 4
42
+ end
39
43
  end
40
44
  end
@@ -1,6 +1,8 @@
1
1
  class <%= klass %> < ActiveRecord::Base
2
2
  include Statesman::Adapters::ActiveRecordTransition
3
3
 
4
+ <% unless rails_4? %>
4
5
  attr_accessible :to_state, :metadata, :sort_key
6
+ <% end %>
5
7
  belongs_to :<%= parent.underscore %>, inverse_of: :<%= table_name %>
6
8
  end
@@ -1,3 +1,3 @@
1
1
  module Statesman
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
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.2.0
4
+ version: 0.2.1
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: 2013-12-16 00:00:00.000000000 Z
12
+ date: 2013-12-31 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler