Skip to content

Instantly share code, notes, and snippets.

@pinzolo
Created August 1, 2014 02:41
Show Gist options
  • Save pinzolo/d71dc92e446fb8f34b1e to your computer and use it in GitHub Desktop.
Save pinzolo/d71dc92e446fb8f34b1e to your computer and use it in GitHub Desktop.
module MyModel
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_model
end
end
module ClassMethods
def i18n_scope_with_my_model
:my_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