rails_admin_jcrop 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +5 -1
- data/lib/rails_admin_jcrop/orm.rb +1 -6
- data/lib/rails_admin_jcrop/version.rb +1 -1
- metadata +3 -4
data/README.markdown
CHANGED
@@ -5,6 +5,10 @@
|
|
5
5
|
1. Add it to your Gemfile and run `bundle install`:
|
6
6
|
|
7
7
|
gem 'rails_admin'
|
8
|
+
# Because rails_admin_jcrop autoload modules by checking plugins you use, it's
|
9
|
+
# recommended to require it explictly before rails_admin_jcrop
|
10
|
+
# e.g. if you use carrierwave
|
11
|
+
# gem 'carrierwave', :require => 'carrierwave'
|
8
12
|
gem 'rails_admin_jcrop' #, git: 'git://github.com/janx/rails_admin_jcrop.git'
|
9
13
|
|
10
14
|
2. Configure your model field to use Jcrop:
|
@@ -94,9 +98,9 @@ Localize the crop form by adding these entries:
|
|
94
98
|
|
95
99
|
## TODO ##
|
96
100
|
|
101
|
+
* make sure rails_admin_jcrop load after paperclip/carrierwave load
|
97
102
|
* automate :rails_admin_crop for CarrierWave uploader
|
98
103
|
|
99
|
-
|
100
104
|
## Contributing ##
|
101
105
|
|
102
106
|
Any help is encouraged. Here are some ways you can contribute:
|
@@ -6,11 +6,6 @@ module RailsAdminJcrop
|
|
6
6
|
|
7
7
|
def self.included(base)
|
8
8
|
base.send :attr_accessor, *CropFields
|
9
|
-
base.after_update :rails_admin_crop_callback, :if => :rails_admin_cropping?
|
10
|
-
end
|
11
|
-
|
12
|
-
def rails_admin_crop_callback
|
13
|
-
::RailsAdminJcrop::AssetEngine.crop!(self, self.crop_field)
|
14
9
|
end
|
15
10
|
|
16
11
|
def rails_admin_cropping?
|
@@ -19,7 +14,7 @@ module RailsAdminJcrop
|
|
19
14
|
|
20
15
|
def rails_admin_crop!(params)
|
21
16
|
CropFields.each {|f| self.send "#{f}=", params[f] }
|
22
|
-
|
17
|
+
::RailsAdminJcrop::AssetEngine.crop!(self, self.crop_field) if self.rails_admin_cropping?
|
23
18
|
end
|
24
19
|
|
25
20
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin_jcrop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
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-
|
12
|
+
date: 2012-11-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -110,9 +110,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
110
|
version: '0'
|
111
111
|
requirements: []
|
112
112
|
rubyforge_project:
|
113
|
-
rubygems_version: 1.8.
|
113
|
+
rubygems_version: 1.8.23
|
114
114
|
signing_key:
|
115
115
|
specification_version: 3
|
116
116
|
summary: Jcrop plugin for rails admin.
|
117
117
|
test_files: []
|
118
|
-
has_rdoc:
|