0.0
No commit activity in last 3 years
No release in over 3 years
Customize active_support instance methods to not raise error when call anomyous method name in instance variable
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 4.2.0
 Project Readme

TryingModels

This project rocks and uses MIT-LICENSE.

Basically to create new Rails Plugins.

In this example, I create acts_as_tryable plugins follow the Rails Guide Plugins.

Understand the ActiveSupport::Concern and deep undertood both include vs extend.

Bundle

gem install trying_models

How

Adding acts_as_tryable to your model file. Ex: app/models/article.rb

class Article < ActiveRecord::Base
  acts_as_tryable
end

Use

Everywhere when you look at the @instance

Ex:

@article = Article.new(name: "example", content: "example")

# try call hello method
@article.hello

# result
# -> "Undefined Method"
# -> it replacement for `raise exception default make app crash`

It not very awesome, It basic and very Simple, It show me how to understand extend include attributes how active record work