infopark_reactor 1.12.0 → 1.13.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
  SHA1:
3
- metadata.gz: 8aa1ef70c7fe940a359d9308caea42920446c005
4
- data.tar.gz: 06b9e2bac2b53a4a8a34fd420c14bfeef5495862
3
+ metadata.gz: b0dc4909f67ad98599bf95e3ee6704ded12afe2b
4
+ data.tar.gz: 291f54855d8900e799ae3c278e2bd1371dbe1534
5
5
  SHA512:
6
- metadata.gz: c83f65d14ee5efe1ad934e0beafe24595e001ee85d6351384b29b80343c02c541951f4f30ac093b4e74273bda24ad523721b44076277f5e8514f82b5f08ba821
7
- data.tar.gz: 3e9f52b16d00daf63bc48eeb8fb6a66dee55cdb121bc8236626bc2a9a2c5374212d7493f01a46342cd33ffbc7f6ea26a63dc1bb92afc82a28cbc50878c1e2d3a
6
+ metadata.gz: a09584c51b669e5c19327223536e1862d35148323cfae7692c13931e617a20219dbeaa4de2039da68c9fe0f723d3e830a16f8e2fb78f6d64887106ecb60525a2
7
+ data.tar.gz: cc5823a445bcc36edd25c6db8f985c62a4fd7b7454b76d0351d5ee76657336de51b24cf51fdcd97efa99710426869d936853ba9d579a4c2f367fc5d733a9a48f
@@ -9,7 +9,11 @@ module Cm
9
9
 
10
10
  source_root File.expand_path('../templates', __FILE__)
11
11
  def create_migration_file
12
- migration_template "template.rb", "cm/migrate/#{file_name}"
12
+ if Reactor.rails4_0? || Reactor.rails4_1?
13
+ migration_template "template.rb", "cm/migrate/#{file_name}.rb"
14
+ else
15
+ migration_template "template.rb", "cm/migrate/#{file_name}"
16
+ end
13
17
  end
14
18
  end
15
19
  end
@@ -11,7 +11,12 @@ module Reactor
11
11
  end
12
12
 
13
13
  def set(key,value)
14
- @params[key.to_sym] = value
14
+ key = key.to_sym
15
+ if key == :attributes
16
+ @attributes = value
17
+ else
18
+ @params[key.to_sym] = value
19
+ end
15
20
  end
16
21
 
17
22
  def add_attributes(attributes)
@@ -34,6 +39,11 @@ module Reactor
34
39
  def migrate_params!(attribute)
35
40
  attribute.add_attributes(@add_attributes) if @add_attributes
36
41
  attribute.remove_attributes(@remove_attributes) if @remove_attributes
42
+ if @attributes
43
+ previous_attributes = attribute.attributes
44
+ attribute.remove_attributes(previous_attributes)
45
+ attribute.add_attributes(@attributes)
46
+ end
37
47
  @params.each{|k,v|attribute.set(k,v)}
38
48
  attribute.save!
39
49
  end
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Reactor
3
- VERSION = "1.12.0"
3
+ VERSION = "1.13.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infopark_reactor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomasz Przedmojski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-01 00:00:00.000000000 Z
11
+ date: 2015-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails