Install backup gem
$ gem install backupGenerate Backup files see doc for genrate's options
| #To turn it off | |
| old_logger = ActiveRecord::Base.logger | |
| ActiveRecord::Base.logger = nil | |
| #To turn it back on | |
| ActiveRecord::Base.logger = old_logger |
Install backup gem
$ gem install backupGenerate Backup files see doc for genrate's options
##Merge many has_many
def get_fb_users
FacebookUser.from("
(
(
#{self.facebook_recipients_users.to_sql}
) union (
#{self.facebook_users.to_sql}
)class MyKlass
include
CONSTANTS
belongs_to
has_one
has_many
accepts_nested_attributes_for
attr_accessible
validates| gid = class_instance.to_global_id # method allowing to get a string with both model name and id | |
| GlobalID::Locator.locate(gid) # method of getting the object by its global id (very useful for collections of multiple type of objects, e.g. for polymorphic associations) | |
| Example : | |
| In the model that has a polymorphic attribute detailable: | |
| getter: | |
| def global_detailable | |
| detailable.to_global_id if detailable.present? |