Skip to content

Repository files navigation

Install

Gemfile

gem'locked', git=>'git@github.com:BlueLemon/Lockable.git'

Model

Model < ActiveRecord::Base
acts_as_locked(:foo, :bar)
end

Migration

classAddLockedToPerson<ActiveRecord::Migrationdefchangeadd_column:model, :locked_at, :datetimeendend

Example of usage

In the Person model add

classPerson<ActiveRecord::Base# name:string# age:integeracts_as_locked(:name)
end

In rails console

p = Person.newp.name = "Oldani Pablo"p.lockp.save# truep.name = "Eloy Espinaco"p.save# falsep = Person.newp.name = "Oldani Pablo"p.lockp.save# truep.age = "30"p.save# true

About

a gem to prevent so save some data

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages