modalfields 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.6
1
+ 1.1.7
@@ -58,9 +58,9 @@ module ModalFields
58
58
  end
59
59
 
60
60
 
61
- class DefinitionsDsl
61
+ class DefinitionsDsl < ActiveSupport::BasicObject
62
62
  def field(name, attributes={})
63
- ModalFields.definitions[name.to_sym] = COMMON_ATTRIBUTES.merge(attributes)
63
+ ::ModalFields.definitions[name.to_sym] = COMMON_ATTRIBUTES.merge(attributes)
64
64
  end
65
65
  def method_missing(name, *args)
66
66
  field(name, *args)
@@ -232,7 +232,7 @@ module ModalFields
232
232
  up << "\n"
233
233
  end
234
234
  up << " end\n"
235
- down << " drop_table #{model.table_name.to_sym.inspect}\n"
235
+ down << " drop_table #{model.table_name.to_sym.inspect}\n"
236
236
  else
237
237
  deleted_fields.each do |field|
238
238
  up << " add_column #{model.table_name.to_sym.inspect}, #{field.name.inspect}, #{field.type.inspect}"
@@ -243,7 +243,7 @@ module ModalFields
243
243
  down << " remove_column #{model.table_name.to_sym.inspect}, #{field.name.inspect}\n"
244
244
  end
245
245
  modified_fields.each do |field|
246
- changed = model.fields_info.find{|f| f.name==field.name}
246
+ changed = model.fields_info.find{|f| f.name.to_sym==field.name.to_sym}
247
247
  up << " change_column #{model.table_name.to_sym.inspect}, #{changed.name.inspect}, #{changed.type.inspect}"
248
248
  unless changed.attributes.empty?
249
249
  up << ", " + changed.attributes.inspect.unwrap('{}')
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "modalfields"
8
- s.version = "1.1.6"
8
+ s.version = "1.1.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Javier Goizueta"]
12
- s.date = "2012-05-17"
12
+ s.date = "2012-05-24"
13
13
  s.description = "ModelFields is a Rails plugin that adds fields declarations to your models."
14
14
  s.email = "jgoizueta@gmail.com"
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modalfields
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.6
4
+ version: 1.1.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-17 00:00:00.000000000 Z
12
+ date: 2012-05-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -214,7 +214,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
214
214
  version: '0'
215
215
  segments:
216
216
  - 0
217
- hash: 4589863407518218042
217
+ hash: -3599470511198925273
218
218
  required_rubygems_version: !ruby/object:Gem::Requirement
219
219
  none: false
220
220
  requirements: