Created
February 22, 2011 13:52
-
-
Save timurvafin/838687 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Post.fetch # fetch post from remote resources and save to the Post | |
Post::Tumblr.fetch # fetch post from Tumblr and save to the Post |
This file contains hidden or 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
# skinnycms/app/models/post.rb | |
class Post < ActiveRecord::Base | |
cattr_accessor :plugins | |
def fetch | |
plugins.each do |plugin| | |
Post.constantize(plugin).fetch | |
end | |
end | |
end |
This file contains hidden or 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
# skinnycms/app/models/post/base.rb | |
class Post::Base | |
end |
This file contains hidden or 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
# skinnycms_wordpress/init.rb | |
require 'app/models/post/wordpress' | |
Post.plugins << 'wordpress' |
This file contains hidden or 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
# skinnycms_wordpress/app/models/post/wordpress.rb | |
class Post::Wordpress < Post::Base | |
def self.fetch | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment