This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Notable | |
def self.included(base) | |
base.has_many :notes, :as => :notable | |
base.accepts_nested_attributes_for :notes | |
end | |
end | |
class User < ActiveRecord::Base | |
include Notable | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# File permissions | |
run "chmod 755 ." | |
%w(public log tmp).each do |dir| | |
run "chmod -R 755 #{dir}" | |
end | |
# Remove unnecessary files | |
%w(README public/index.html public/favicon.ico public/robots.txt).each do |file| | |
run "rm #{file}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Image < ActiveRecord::Base | |
# associations | |
belongs_to :image_attachment, :polymorphic => true | |
# virtual attributes | |
attr_accessor :image_styles | |
def after_initialize | |
self.image_styles=(set_image_styles) | |
# set an obvious fake to test param passing works |
NewerOlder