Skip to content

Instantly share code, notes, and snippets.

@pinzolo
Created August 3, 2014 05:15
Show Gist options
  • Save pinzolo/0e497fd727e649bf7ab7 to your computer and use it in GitHub Desktop.
Save pinzolo/0e497fd727e649bf7ab7 to your computer and use it in GitHub Desktop.
module MyPlugin::Model
extend ActiveSupport::Concern
included do
__send__(:include, ActiveModel::Conversion)
__send__(:include, ActiveModel::Validations)
extend ActiveModel::Naming
extend ActiveModel::Translation
class << self
alias_method_chain :i18n_scope, :my_plugin_model
end
end
module ClassMethods
def i18n_scope_with_my_plugin_model
:my_plugin_model
end
end
def persisted?
false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment