rails_kindeditor 0.3.16 → 0.3.17

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: 1ec1c8cf8e810c9bc12a13f6bd1efb3f10818a0c
4
- data.tar.gz: aabd2dde91fca3a5469ad062831ee78ae3a431c2
3
+ metadata.gz: 3643ee800f464c968f45239fa565fe6740acd75d
4
+ data.tar.gz: cbea227339ccb636aa82c0f4712c59d77d4a497d
5
5
  SHA512:
6
- metadata.gz: b09e83fccbba0a9ebd3e1a3c97d6ae0e6ec9822719da688dcef792738b766492887de8ea909dcf31aae9f1221bcb0380ace3aae3d39e473e80973aaab913ce0c
7
- data.tar.gz: 4029988064429d22be68bc02928d2e7dbbf520772eebb3c786d22d9ad46e5c261fcfa65924481249632470203f25025af365ed6ef4c2b7aad20fbcd8a41888b2
6
+ metadata.gz: 40fc9bc931c1f8c4b5d9109786d207c4eb87593ae5dba999066ebdc8683cfdb8994aaf94512e700f2d761e7b9f7f1152ae7081c202c890abadae9dc5fe0ff0df
7
+ data.tar.gz: cddc998e2bcd5fd298bc923099bfbd60a8504654b1d5bea641720df823bed5ae452c37dcf15639b95b4eab959a747102fa8a109558a67cafeb13501e16a96c8c
data/README.md CHANGED
@@ -10,7 +10,7 @@ rails_kindeditor will helps your rails app integrate with kindeditor, includes i
10
10
  ### Add this to your Gemfile
11
11
 
12
12
  ```ruby
13
- gem 'rails_kindeditor', '~> 0.3.16'
13
+ gem 'rails_kindeditor', '~> 0.3.17'
14
14
  ```
15
15
 
16
16
  ### Run "bundle" command.
@@ -163,7 +163,7 @@ rails_kindeditor可以帮助你的rails程序集成kindeditor,包括了图片和
163
163
  ### 将下面代码加入Gemfile:
164
164
 
165
165
  ```ruby
166
- gem 'rails_kindeditor', '~> 0.3.16'
166
+ gem 'rails_kindeditor', '~> 0.3.17'
167
167
  ```
168
168
 
169
169
  ### 运行"bundle"命令:
@@ -11,6 +11,9 @@ module RailsKindeditor
11
11
  %w(asset file flash image media).each do |file|
12
12
  copy_model(orm, file)
13
13
  end
14
+ if Rails.version < '4.0.0' && Rails.version >= '3.0.0' # insert code for rails3
15
+ insert_into_file "app/models/kindeditor/asset.rb", " attr_accessible :asset\n", :after => "before_save :update_asset_attributes\n"
16
+ end
14
17
  if orm == "active_record"
15
18
  migration_template "migration/migration.rb", "db/migrate/create_kindeditor_assets.rb"
16
19
  end
@@ -2,7 +2,6 @@ class CreateKindeditorAssets < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :kindeditor_assets do |t|
4
4
  t.string :asset
5
- t.string :file_name
6
5
  t.integer :file_size
7
6
  t.string :file_type
8
7
  t.timestamps
@@ -1,9 +1,8 @@
1
1
  class Kindeditor::Asset < ActiveRecord::Base
2
2
  self.table_name = 'kindeditor_assets'
3
- mount_uploader :asset, AssetUploader
3
+ mount_uploader :asset, Kindeditor::AssetUploader
4
4
  validates_presence_of :asset
5
5
  before_save :update_asset_attributes
6
- attr_accessible :asset
7
6
 
8
7
  private
9
8
  def update_asset_attributes
@@ -3,12 +3,11 @@ require 'carrierwave/mongoid'
3
3
  class Kindeditor::Asset
4
4
  include Mongoid::Document
5
5
  include Mongoid::Timestamps
6
- mount_uploader :asset, AssetUploader
6
+ mount_uploader :asset, Kindeditor::AssetUploader
7
7
  field :file_size, :type => Integer
8
8
  field :file_type, :type => String
9
9
  validates_presence_of :asset
10
10
  before_save :update_asset_attributes
11
- attr_accessible :asset
12
11
 
13
12
  def self.collection_name
14
13
  :kindeditor_assets
@@ -1,4 +1,4 @@
1
1
  module RailsKindeditor
2
- VERSION = "0.3.16"
2
+ VERSION = "0.3.17"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_kindeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.16
4
+ version: 0.3.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Macrow
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-04 00:00:00.000000000 Z
11
+ date: 2013-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave