avatars_for_rails 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
data/README.rdoc
CHANGED
@@ -45,10 +45,12 @@ In config/initializers/avatars_for_rails.rb you have to define:
|
|
45
45
|
AvatarsForRails.setup do |config|
|
46
46
|
config.avatarable_model = :actor
|
47
47
|
config.current_avatarable_object = :current_actor
|
48
|
+
config.avatarable_filters = [:authenticate_user!]
|
48
49
|
end
|
49
50
|
|
50
51
|
* actor is the name of the object owner of the avatars
|
51
52
|
* current_actor will return the actor you wants to be the owner of the new avatars, etc For example, you can return the current logged in actor. This method can be defined on the application_controller of your app.
|
53
|
+
* authenticate_user! is the filter which will be applied as a before_filter for the avatars. You can use as many as you want.
|
52
54
|
|
53
55
|
Finally, add to your actor model the relation with avatars_for_rails:
|
54
56
|
|
data/app/models/avatar.rb
CHANGED
@@ -2,10 +2,7 @@ require 'RMagick'
|
|
2
2
|
|
3
3
|
class Avatar < ActiveRecord::Base
|
4
4
|
has_attached_file :logo,
|
5
|
-
:styles =>
|
6
|
-
:tie => "30x30>",
|
7
|
-
:actor => '35x35>',
|
8
|
-
:profile => '94x94' },
|
5
|
+
:styles => AvatarsForRails.avatarable_styles,
|
9
6
|
:default_url => "/images/logos/:style/:subtype_class.png"
|
10
7
|
|
11
8
|
before_post_process :process_precrop
|
data/avatars_for_rails.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
# project in your rails apps through git.
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "avatars_for_rails"
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.9"
|
6
6
|
s.authors = ["Jaime Castro Montero"]
|
7
7
|
s.summary = "Avatar manager for rails apps."
|
8
8
|
s.description = "A Rails engine that allows any model to act as avatarable, permitting it to have a complete avatar manager with a few options."
|
data/lib/avatars_for_rails.rb
CHANGED
@@ -2,4 +2,9 @@ AvatarsForRails.setup do |config|
|
|
2
2
|
config.avatarable_model = :<%= file_name %>
|
3
3
|
config.current_avatarable_object = :current_<%= file_name %>
|
4
4
|
config.avatarable_filters = []
|
5
|
+
config.avatarable_styles = { :representation => "20x20>",
|
6
|
+
:tie => "30x30>",
|
7
|
+
:actor => '35x35>',
|
8
|
+
:profile => '94x94'}
|
9
|
+
|
5
10
|
end
|
@@ -2,4 +2,8 @@ AvatarsForRails.setup do |config|
|
|
2
2
|
config.avatarable_model = :actor
|
3
3
|
config.current_avatarable_object = :current_actor
|
4
4
|
config.avatarable_filters = []
|
5
|
+
config.avatarable_styles = { :representation => "20x20>",
|
6
|
+
:tie => "30x30>",
|
7
|
+
:actor => '35x35>',
|
8
|
+
:profile => '94x94'}
|
5
9
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avatars_for_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 9
|
10
|
+
version: 0.0.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jaime Castro Montero
|