inline_forms 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.1
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{inline_forms}
8
- s.version = "0.7.0"
8
+ s.version = "0.7.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Ace Suares"]
@@ -1,9 +1,17 @@
1
1
  class InlineFormsCreate<%= table_name.camelize %> < ActiveRecord::Migration
2
+
2
3
  def self.up
3
4
  create_table :<%= table_name %> do |t|
4
5
  <% for attribute in attributes -%>
6
+ <% if attribute.migration_type == :image -%>
7
+ <%= ' t.string :' + attribute.migration_name + "_file_name" %>
8
+ <%= ' t.string :' + attribute.migration_name + "_content_type" %>
9
+ <%= ' t.integer :' + attribute.migration_name + "_file_size" %>
10
+ <%= ' t.datetime :' + attribute.migration_name + "_updated_at" %>
11
+ <% else -%>
5
12
  <%= ( attribute.migration_type == :unknown || attribute.special_relation? ) ? '#' : ' ' -%>
6
13
  <%= ' t.' + attribute.migration_type.to_s %> :<%= attribute.migration_name %>
14
+ <% end -%>
7
15
  <% end -%>
8
16
  t.timestamps
9
17
  end
@@ -5,6 +5,9 @@ class <%= name %> < ActiveRecord::Base
5
5
  <% end -%>
6
6
  <% for attribute in attributes -%>
7
7
  <%= ' has_many :' + attribute.name + "\n" if attribute.has_many? -%>
8
+ <% end -%>
9
+ <% for attribute in attributes -%>
10
+ <%= " has_attached_file :#{attribute.name}, :styles => { :medium => \"300x300>\", :thumb => \"100x100>\" }\n" if attribute.type == :image -%>
8
11
  <% end -%>
9
12
 
10
13
  def _presentation
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 0
10
- version: 0.7.0
9
+ - 1
10
+ version: 0.7.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ace Suares