praveenkumarsinha / photofy Goto Github PK
View Code? Open in Web Editor NEWA gem to provide simple method to do fileupload of pictures and provides getter setter methods of it and save on model object commit
A gem to provide simple method to do fileupload of pictures and provides getter setter methods of it and save on model object commit
If user upload invalid file format then gem should raise an exception for invalid file format, say if I validate photofy only for '.docx' file then other file format is not uploaded but its not raising any exception that file format in not valid.
2.1.2 :003 > cat = Category.find 27
Category Load (0.4ms) SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 27 LIMIT 1
=> #<Category id: 27, title: "CatnameUnder", parent_id: 26, lft: 52, rgt: 53, depth: 1, status: 0, account_id: 1, created_at: "2014-08-07 05:34:47", updated_at: "2014-08-07 05:34:47">
2.1.2 :004 > cat.icon_path
=> "/home/kannav/workspace/headerlabs/rails_apps/papayaheaderlabs.clementine/photofy/Category/icon/27_Screenshot from 2014-07-11 17:19:47.png"
2.1.2 :005 > cat.icon?
=> true
2.1.2 :006 > cat = Category.find 22
Category Load (0.5ms) SELECT `categories`.* FROM `categories` WHERE `categories`.`id` = 22 LIMIT 1
=> #<Category id: 22, title: "underSachin", parent_id: 21, lft: 41, rgt: 42, depth: 2, status: 0, account_id: 1, created_at: "2014-08-06 13:42:21", updated_at: "2014-08-06 13:42:21">
2.1.2 :007 > cat.icon_path
=> nil
2.1.2 :008 > cat.icon?
TypeError: no implicit conversion of nil into String
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/photofy-0.2.1/lib/photofy/core.rb:148:in `file?'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/photofy-0.2.1/lib/photofy/core.rb:148:in `block in photofy'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/photofy-0.2.1/lib/photofy/core.rb:104:in `block in photofy'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/photofy-0.2.1/lib/photofy/core.rb:112:in `block in photofy'
from (irb):8
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/railties-4.1.2/lib/rails/commands/console.rb:90:in `start'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/railties-4.1.2/lib/rails/commands/console.rb:9:in `start'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/railties-4.1.2/lib/rails/commands/commands_tasks.rb:69:in `console'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/railties-4.1.2/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/railties-4.1.2/lib/rails/commands.rb:17:in `<top (required)>'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:247:in `require'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:247:in `block in require'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:232:in `load_dependency'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:247:in `require'
from /home/kannav/workspace/headerlabs/rails_apps/papayaheaderlabs.clementine/bin/rails:8:in `<top (required)>'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:241:in `load'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:241:in `block in load'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:232:in `load_dependency'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/activesupport-4.1.2/lib/active_support/dependencies.rb:241:in `load'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/spring-1.1.3/lib/spring/commands/rails.rb:6:in `call'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/spring-1.1.3/lib/spring/command_wrapper.rb:38:in `call'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/spring-1.1.3/lib/spring/application.rb:180:in `block in serve'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/spring-1.1.3/lib/spring/application.rb:153:in `fork'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/spring-1.1.3/lib/spring/application.rb:153:in `serve'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/spring-1.1.3/lib/spring/application.rb:128:in `block in run'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/spring-1.1.3/lib/spring/application.rb:122:in `loop'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/spring-1.1.3/lib/spring/application.rb:122:in `run'
from /home/kannav/.rvm/gems/ruby-2.1.2@clementine/gems/spring-1.1.3/lib/spring/application/boot.rb:18:in `<top (required)>'
from /home/kannav/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /home/kannav/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'2.1.2 :009 >
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.