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 +4 -4
- data/README.md +2 -2
- data/lib/generators/rails_kindeditor/migration/migration_generator.rb +3 -0
- data/lib/generators/rails_kindeditor/migration/templates/migration/migration.rb +0 -1
- data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb +1 -2
- data/lib/generators/rails_kindeditor/migration/templates/models/mongoid/kindeditor/asset.rb +1 -2
- data/lib/rails_kindeditor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3643ee800f464c968f45239fa565fe6740acd75d
|
4
|
+
data.tar.gz: cbea227339ccb636aa82c0f4712c59d77d4a497d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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.
|
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
|
data/lib/generators/rails_kindeditor/migration/templates/models/active_record/kindeditor/asset.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2013-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|