Advertisement
Guest User

Untitled

a guest
Feb 21st, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. class StatisticVariable < ActiveRecord::Base
  2. attr_accessible :code, :name
  3.  
  4. has_many :statistic_values
  5.  
  6. scope :logins, where(code: 'logins').first
  7. scope :unique_logins, where(code: 'unique_logins').first
  8. scope :registrations, where(code: 'registrations').first
  9.  
  10. end
  11.  
  12. def self.registrations
  13. where(code: 'registrations').first
  14. end
  15.  
  16. scope :logins, where(code: 'logins')
  17. scope :unique_logins, where(code: 'unique_logins')
  18. scope :registrations, where(code: 'registrations')
  19.  
  20. def self.login
  21. logins.first
  22. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement