Getting started
Concernize works from rails4.x.x:
gem 'concernize'Run the bundle command to install it.
Once you are done with installation, you are ready to generate your concern files.
rails generate concernize models film concernThis will generate a concern file on the following directory
# app/models/concerns/film_concern.rb
module FileConcern
extend ActiveSupport::Concern
# define your object level methods here...
# def method_one
# puts "wow!! working!!!"
# end
# included do
# #type your class methods here...
# end
# class Post < ActiveRecord::Base
# include FileConcern
# end
endThe last argument (concern_namespace) is optional. You can generate a concern without a concern_namespace.
License
MIT-LICENSE. Free for humans :-)